-
-
Notifications
You must be signed in to change notification settings - Fork 676
Allow duplicate fields #2158
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
Merged
dcodeIO
merged 13 commits into
AssemblyScript:main
from
romdotdog:refactor-duplicate-fields
Dec 2, 2021
Merged
Allow duplicate fields #2158
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ba106b3
initial fix
romdotdog 948d235
redundant field diagnostic + `declare` parsing
romdotdog 10272de
fix error lines
romdotdog 61db171
fix `declare` as identifier
romdotdog 34ecdfd
fix
romdotdog ea6705a
patch non-field base member crash
romdotdog 893e052
revise tests to ensure existing memory offset use
romdotdog 0bd2c80
remove `declare` for fields
romdotdog d3ed920
more
romdotdog 0d27e0e
fix tests
romdotdog 96fbcf5
handle protected fields
romdotdog d882877
revise visibility checks
romdotdog b86912a
revise tests + remove overwrite error
romdotdog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"asc_flags": [ | ||
], | ||
"stderr": [ | ||
"TS2325: Property 'a' is private in type 'duplicate-field-errors/A' but not in type 'duplicate-field-errors/B'.", | ||
"TS2325: Property 'b' is private in type 'duplicate-field-errors/B' but not in type 'duplicate-field-errors/A'.", | ||
"TS2442: Types have separate declarations of a private property 'c'.", | ||
"TS2416: Property 'd' in type 'duplicate-field-errors/B' is not assignable to the same property in base type 'duplicate-field-errors/A'.", | ||
"TS2612: Property 'e' will overwrite the base property in 'duplicate-field-errors/A'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration." | ||
] | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class A { | ||
private a: i32; | ||
public b: i32; | ||
private c: i32; | ||
public d: i64; | ||
public e: i32; | ||
constructor(a: i32, b: i32, c: i32, d: i64, e: i32) { | ||
this.a = a; | ||
this.b = b; | ||
this.c = c; | ||
this.d = d; | ||
this.e = e; | ||
} | ||
} | ||
|
||
export class B extends A { | ||
public a: i32; | ||
private b: i32; | ||
private c: i32; | ||
public d: i32; | ||
public e: i32; | ||
constructor(a: i32, b: i32, c: i32, d: i32, e: i32) { | ||
super(a, b, c, d, e); | ||
} | ||
} | ||
|
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"asc_flags": [ | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.