From c3c09795614f31f988edc9cb051ce024d1996d89 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 24 Feb 2019 17:29:07 +0100 Subject: Add test for recursive type aliases --- crates/ra_hir/src/ty/tests.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'crates/ra_hir/src') 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 @@ -761,6 +761,20 @@ fn test(x: Foo, y: Bar<&str>, z: Baz) { ) } +#[test] +#[should_panic] // we currently can't handle this +fn recursive_type_alias() { + check_inference( + "recursive_type_alias", + r#" +struct A {}; +type Foo = Foo; +type Bar = A; +fn test(x: Foo) {} +"#, + ) +} + #[test] fn no_panic_on_field_of_enum() { check_inference( -- cgit v1.2.3