diff options
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index d0da34677..490c087f9 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -741,6 +741,27 @@ fn test() { | |||
741 | } | 741 | } |
742 | 742 | ||
743 | #[test] | 743 | #[test] |
744 | fn infer_type_alias() { | ||
745 | check_inference( | ||
746 | "infer_type_alias", | ||
747 | r#" | ||
748 | struct A<X, Y> { x: X, y: Y }; | ||
749 | type Foo = A<u32, i128>; | ||
750 | type Bar<T> = A<T, u128>; | ||
751 | type Baz<U, V> = A<V, U>; | ||
752 | fn test(x: Foo, y: Bar<&str>, z: Baz<i8, u8>) { | ||
753 | x.x; | ||
754 | x.y; | ||
755 | y.x; | ||
756 | y.y; | ||
757 | z.x; | ||
758 | z.y; | ||
759 | } | ||
760 | "#, | ||
761 | ) | ||
762 | } | ||
763 | |||
764 | #[test] | ||
744 | fn no_panic_on_field_of_enum() { | 765 | fn no_panic_on_field_of_enum() { |
745 | check_inference( | 766 | check_inference( |
746 | "no_panic_on_field_of_enum", | 767 | "no_panic_on_field_of_enum", |