-
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
chore: Rename StructDefinition
to TypeDefinition
#7614
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.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20
.
Benchmark suite | Current: 763df5a | Previous: ba5beb6 | Ratio |
---|---|---|---|
noir-lang_noir_bigcurve_ |
266 s |
220 s |
1.21 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
🚀 Deployed on https://67cb2ad294bf9fef87674374--noir-docs.netlify.app |
FYI @noir-lang/developerrelations on Noir doc changes. |
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 #7416
Summary*
Renames
StructDefinition
toTypeDefinition
and renamesType::as_struct
toType::as_data_type
for lack of a better name.StructDefinition
still works but will produce a deprecated warningType::as_struct
similarly still works and callsType::as_data_type
, also producing a deprecated warning.Due to the above, this PR is non-breaking. Eventually we'll still probably want breaking type changes though. Namely any function to retrieve the struct fields from a
TypeDefinition
should be changed to return aOption
of the previous return type since it may be called with an enum now.Additional Context
Compared to separating
StructDefinition
fromEnumDefinition
I think this way is more convenient since it allows users to define one attribute function to work on all data types, instead of requiring a separate function to handle structs & enums. The later would also necessitate we needed a separatestruct_derive
andenum_derive
, etc.Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.