forked from noir-lang/noir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: rename struct-specific TypeDefinition -> StructDefinition (noi…
…r-lang#5356) # Description ## Problem\* `TypeDefinition` is currently struct-specific ## Summary\* ## Additional Context ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
- Loading branch information
1 parent
6936a52
commit 7ffccf7
Showing
10 changed files
with
45 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
impl TypeDefinition { | ||
/// Return a syntactic version of this type definition as a type. | ||
impl StructDefinition { | ||
/// Return a syntactic version of this struct definition as a type. | ||
/// For example, `as_type(quote { type Foo<A, B> { ... } })` would return `Foo<A, B>` | ||
#[builtin(type_def_as_type)] | ||
#[builtin(struct_def_as_type)] | ||
fn as_type(self) -> Quoted {} | ||
|
||
/// Return each generic on this type. The names of these generics are unchanged | ||
/// Return each generic on this struct. The names of these generics are unchanged | ||
/// so users may need to keep name collisions in mind if this is used directly in a macro. | ||
#[builtin(type_def_generics)] | ||
#[builtin(struct_def_generics)] | ||
fn generics(self) -> [Quoted] {} | ||
|
||
/// Returns (name, type) pairs of each field in this type. Each type is as-is | ||
/// Returns (name, type) pairs of each field in this struct. Each type is as-is | ||
/// with any generic arguments unchanged. | ||
#[builtin(type_def_fields)] | ||
#[builtin(struct_def_fields)] | ||
fn fields(self) -> [(Quoted, Quoted)] {} | ||
} |
2 changes: 1 addition & 1 deletion
2
test_programs/compile_failure/type_definition_annotation/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters