-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Error on infinitely recursive types #7579
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a test for Foo<Bar<()>>
where both Foo
and Bar
are enums? Or if that case works, what about if Bar
is an alias or struct-wrapper of Foo
?
Naming nit: are these recursive types or simply nested enums? I'd expect the error to be more similar to the nested slices error.
They're.. semi-recursive enums. Nested enums like |
…g/noir into jf/recursive-type-error
@michaeljklein Added more tests |
feat: add optional oracle resolver url in `acvm_cli` (noir-lang/noir#7630) chore: Rename `StructDefinition` to `TypeDefinition` (noir-lang/noir#7614) fix: Error on infinitely recursive types (noir-lang/noir#7579) fix: update error message to display 128 bits as valid bit size (noir-lang/noir#7626) chore: update docs to reflect u128 type (noir-lang/noir#7623) feat: array concat method (noir-lang/noir#7199)
feat: add optional oracle resolver url in `acvm_cli` (noir-lang/noir#7630) chore: Rename `StructDefinition` to `TypeDefinition` (noir-lang/noir#7614) fix: Error on infinitely recursive types (noir-lang/noir#7579) fix: update error message to display 128 bits as valid bit size (noir-lang/noir#7626) chore: update docs to reflect u128 type (noir-lang/noir#7623) feat: array concat method (noir-lang/noir#7199)
feat: add optional oracle resolver url in `acvm_cli` (noir-lang/noir#7630) chore: Rename `StructDefinition` to `TypeDefinition` (noir-lang/noir#7614) fix: Error on infinitely recursive types (noir-lang/noir#7579) fix: update error message to display 128 bits as valid bit size (noir-lang/noir#7626) chore: update docs to reflect u128 type (noir-lang/noir#7623) feat: array concat method (noir-lang/noir#7199)
Description
Problem*
Resolves #7173
Summary*
Adds a check during monomorphization that we never create any recursive types which are likely to be infinitely sized.
Additional Context
I also added a file for monomorphization tests so we don't have to keep creating a full
test_program
for these monomorphization errors.Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.