aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/tests/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/tests/macros.rs')
-rw-r--r--crates/hir_ty/src/tests/macros.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/hir_ty/src/tests/macros.rs b/crates/hir_ty/src/tests/macros.rs
index cbe05a5c1..8de1e229f 100644
--- a/crates/hir_ty/src/tests/macros.rs
+++ b/crates/hir_ty/src/tests/macros.rs
@@ -1243,3 +1243,29 @@ fn macros_in_type_generics() {
1243 "#]], 1243 "#]],
1244 ); 1244 );
1245} 1245}
1246
1247#[test]
1248fn infinitely_recursive_macro_type() {
1249 check_infer(
1250 r#"
1251 struct Bar<T>(T);
1252
1253 macro_rules! Foo {
1254 () => { Foo!() }
1255 }
1256
1257 type A = Foo!();
1258 type B = Bar<Foo!()>;
1259
1260 fn main() {
1261 let a: A;
1262 let b: B;
1263 }
1264 "#,
1265 expect![[r#"
1266 112..143 '{ ...: B; }': ()
1267 122..123 'a': {unknown}
1268 136..137 'b': Bar<{unknown}>
1269 "#]],
1270 );
1271}