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
@@ -38,6 +38,7 @@
|
||||
- Taking `.ordinal` from an enum passed by pointer and then taking the address of this result would return the enum, not int.
|
||||
- Alias and distinct types didn't check the underlying type wasn't compile time or optional.
|
||||
- Incorrect nameof on nested struct names. #2492
|
||||
- Issue not correctly aborting compilation on recursive generics.
|
||||
|
||||
### Stdlib changes
|
||||
- Added generic `InterfaceList` to store a list of values that implement a specific interface
|
||||
|
||||
@@ -5207,6 +5207,7 @@ Decl *sema_analyse_parameterized_identifier(SemaContext *c, Path *decl_path, con
|
||||
if (stage > ANALYSIS_POST_REGISTER)
|
||||
{
|
||||
sema_analyze_stage(instantiated_module, stage);
|
||||
if (compiler.context.errors_found) return poisoned_decl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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