diff options
author | Florian Diebold <[email protected]> | 2019-02-24 16:29:07 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-02-24 19:54:04 +0000 |
commit | c3c09795614f31f988edc9cb051ce024d1996d89 (patch) | |
tree | b22232818d8d8ad8fff5b11b1656e2602115cd55 /crates/ra_hir | |
parent | 5d72b96988587699e0a1c62c08bd76d2a7fed100 (diff) |
Add test for recursive type aliases
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 490c087f9..642259225 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -762,6 +762,20 @@ fn test(x: Foo, y: Bar<&str>, z: Baz<i8, u8>) { | |||
762 | } | 762 | } |
763 | 763 | ||
764 | #[test] | 764 | #[test] |
765 | #[should_panic] // we currently can't handle this | ||
766 | fn recursive_type_alias() { | ||
767 | check_inference( | ||
768 | "recursive_type_alias", | ||
769 | r#" | ||
770 | struct A<X> {}; | ||
771 | type Foo = Foo; | ||
772 | type Bar = A<Bar>; | ||
773 | fn test(x: Foo) {} | ||
774 | "#, | ||
775 | ) | ||
776 | } | ||
777 | |||
778 | #[test] | ||
765 | fn no_panic_on_field_of_enum() { | 779 | fn no_panic_on_field_of_enum() { |
766 | check_inference( | 780 | check_inference( |
767 | "no_panic_on_field_of_enum", | 781 | "no_panic_on_field_of_enum", |