mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Issue not correctly aborting compilation on recursive generics.
This commit is contained in:
committed by
Christoffer Lerno
parent
44d736a537
commit
eaeafb7299
22
test/test_suite/generic/recursive_generic2.c3
Normal file
22
test/test_suite/generic/recursive_generic2.c3
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user