diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-11047.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-11047.rs b/src/test/ui/issues/issue-11047.rs new file mode 100644 index 000000000..1fb2b5bb3 --- /dev/null +++ b/src/test/ui/issues/issue-11047.rs @@ -0,0 +1,26 @@ +// run-pass +// Test that static methods can be invoked on `type` aliases + +#![allow(unused_variables)] + +pub mod foo { + pub mod bar { + pub mod baz { + pub struct Qux; + + impl Qux { + pub fn new() {} + } + } + } +} + +fn main() { + + type Ham = foo::bar::baz::Qux; + let foo = foo::bar::baz::Qux::new(); // invoke directly + let bar = Ham::new(); // invoke via type alias + + type StringVec = Vec<String>; + let sv = StringVec::new(); +} |