forked from AssemblyScript/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix constructor parameter initialization order (AssemblyScript#1934
- Loading branch information
Showing
15 changed files
with
566 additions
and
144 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"asc_flags": [ | ||
], | ||
"stderr": [ | ||
"TS2333: 'this' cannot be referenced in constructor arguments.", | ||
"b: i32 = this.a, // TS2333", | ||
"TS2333: 'this' cannot be referenced in constructor arguments.", | ||
"c: i32 = this.foo() // TS2333", | ||
"TS2333: 'this' cannot be referenced in constructor arguments.", | ||
"e: i32 = this.d, // TS2333", | ||
"TS2333: 'this' cannot be referenced in constructor arguments.", | ||
"f: i32 = this.bar() // TS2333", | ||
"TS2336: 'super' cannot be referenced in constructor arguments.", | ||
"h: i32 = super.g, // TS2336", | ||
"TS2336: 'super' cannot be referenced in constructor arguments.", | ||
"i: i32 = super.baz() // TS2336", | ||
"TS2336: 'super' cannot be referenced in constructor arguments.", | ||
"j: i32 = super.g, // TS2336", | ||
"TS2336: 'super' cannot be referenced in constructor arguments.", | ||
"k: i32 = super.baz() // TS2336", | ||
"EOF" | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
class CtorAccessThis { | ||
a: i32 = 0; | ||
constructor( | ||
public b: i32 = this.a, // TS2333 | ||
public c: i32 = this.foo() // TS2333 | ||
) {} | ||
foo(): i32 { return 0; } | ||
} | ||
|
||
new CtorAccessThis(); | ||
|
||
class CtorAccessThisInline { | ||
d: i32 = 0; | ||
@inline | ||
constructor( | ||
public e: i32 = this.d, // TS2333 | ||
public f: i32 = this.bar() // TS2333 | ||
) {} | ||
bar(): i32 { return 0; } | ||
} | ||
|
||
new CtorAccessThisInline(); | ||
|
||
class CtorSuper { | ||
g: i32 = 0; | ||
baz(): i32 { return 0; } | ||
} | ||
|
||
class CtorAccessSuper extends CtorSuper { | ||
constructor( | ||
public h: i32 = super.g, // TS2336 | ||
public i: i32 = super.baz() // TS2336 | ||
) { | ||
super(); | ||
} | ||
} | ||
|
||
new CtorAccessSuper(); | ||
|
||
class CtorAccessSuperInline extends CtorSuper { | ||
@inline | ||
constructor( | ||
public j: i32 = super.g, // TS2336 | ||
public k: i32 = super.baz() // TS2336 | ||
) { | ||
super(); | ||
} | ||
} | ||
|
||
new CtorAccessSuperInline(); | ||
|
||
ERROR("EOF"); |
Oops, something went wrong.