From 5d72b96988587699e0a1c62c08bd76d2a7fed100 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 24 Feb 2019 17:25:41 +0100 Subject: Implement support for type aliases --- crates/ra_hir/src/ty/tests.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'crates/ra_hir/src/ty/tests.rs') 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 @@ -740,6 +740,27 @@ fn test() { ); } +#[test] +fn infer_type_alias() { + check_inference( + "infer_type_alias", + r#" +struct A { x: X, y: Y }; +type Foo = A; +type Bar = A; +type Baz = A; +fn test(x: Foo, y: Bar<&str>, z: Baz) { + x.x; + x.y; + y.x; + y.y; + z.x; + z.y; +} +"#, + ) +} + #[test] fn no_panic_on_field_of_enum() { check_inference( -- cgit v1.2.3