aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/tests.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-02-24 16:25:41 +0000
committerFlorian Diebold <[email protected]>2019-02-24 19:54:04 +0000
commit5d72b96988587699e0a1c62c08bd76d2a7fed100 (patch)
treecfc5c55e0d2ba5fcea6b508c20e23cb43b7f9956 /crates/ra_hir/src/ty/tests.rs
parent5a684099e9aa3482b408002030fafe1dcd0fa9a9 (diff)
Implement support for type aliases
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r--crates/ra_hir/src/ty/tests.rs21
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]
744fn infer_type_alias() {
745 check_inference(
746 "infer_type_alias",
747 r#"
748struct A<X, Y> { x: X, y: Y };
749type Foo = A<u32, i128>;
750type Bar<T> = A<T, u128>;
751type Baz<U, V> = A<V, U>;
752fn 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]
744fn no_panic_on_field_of_enum() { 765fn 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",