Issue not correctly aborting compilation on recursive generics.

This commit is contained in:
Christoffer Lerno
2025-09-22 21:11:48 +02:00
committed by Christoffer Lerno
parent 44d736a537
commit eaeafb7299
3 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
module foo { Type };
import std::collections::list;
struct Foo {
Type foo;
Allocator allocator;
List { Foo } children; // #error: Recursive definition of 'Foo'
}
module test;
import std::collections::list;
import foo;
fn int main(String[] args)
{
Foo { int } test;
// assume we add children here but it's irrelevant for the repro
Foo {int} [] range = test.children[4:20];
return 0;
}