-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Fix crash in isolatedDeclarations on this.x = … assignments
#64471
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
Open
Mateusz Burzyński (Andarist)
wants to merge
2
commits into
microsoft:main
Choose a base branch
from
Andarist:fix/isolated-decls-this-expando-crash
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions
15
...lines/reference/compiler/isolatedDeclarationsJsThisPropertyAssignmentInference.errors.txt
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,15 @@ | ||
| error TS5053: Option 'allowJs' cannot be specified with option 'isolatedDeclarations'. | ||
| a.js(4,9): error TS9013: Expression type can't be inferred with --isolatedDeclarations. | ||
|
|
||
|
|
||
| !!! error TS5053: Option 'allowJs' cannot be specified with option 'isolatedDeclarations'. | ||
| ==== a.js (1 errors) ==== | ||
| function foo() { return 1; } | ||
| export class C { | ||
| constructor() { | ||
| this.x = foo(); | ||
| ~~~~~~~~~~~~~~ | ||
| !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. | ||
| } | ||
| } | ||
|
|
18 changes: 18 additions & 0 deletions
18
...aselines/reference/compiler/isolatedDeclarationsJsThisPropertyAssignmentInference.symbols
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,18 @@ | ||
| //// [tests/cases/compiler/isolatedDeclarationsJsThisPropertyAssignmentInference.ts] //// | ||
|
|
||
| === a.js === | ||
| function foo() { return 1; } | ||
| >foo : Symbol(foo, Decl(a.js, 0, 0)) | ||
|
|
||
| export class C { | ||
| >C : Symbol(C, Decl(a.js, 0, 28)) | ||
|
|
||
| constructor() { | ||
| this.x = foo(); | ||
| >this.x : Symbol(C.x, Decl(a.js, 2, 19)) | ||
| >this : Symbol(C, Decl(a.js, 0, 28)) | ||
| >x : Symbol(C.x, Decl(a.js, 2, 19)) | ||
| >foo : Symbol(foo, Decl(a.js, 0, 0)) | ||
| } | ||
| } | ||
|
|
21 changes: 21 additions & 0 deletions
21
.../baselines/reference/compiler/isolatedDeclarationsJsThisPropertyAssignmentInference.types
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,21 @@ | ||
| //// [tests/cases/compiler/isolatedDeclarationsJsThisPropertyAssignmentInference.ts] //// | ||
|
|
||
| === a.js === | ||
| function foo() { return 1; } | ||
| >foo : () => number | ||
| >1 : 1 | ||
|
|
||
| export class C { | ||
| >C : C | ||
|
|
||
| constructor() { | ||
| this.x = foo(); | ||
| >this.x = foo() : number | ||
| >this.x : any | ||
| >this : this | ||
| >x : any | ||
| >foo() : number | ||
| >foo : () => number | ||
| } | ||
| } | ||
|
|
38 changes: 38 additions & 0 deletions
38
...piler/isolatedDeclarationsNonIdentifierAssignmentInference(isolateddeclarations=false).js
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,38 @@ | ||
| //// [tests/cases/compiler/isolatedDeclarationsNonIdentifierAssignmentInference.ts] //// | ||
|
|
||
| //// [isolatedDeclarationsNonIdentifierAssignmentInference.ts] | ||
| declare function foo(): number; | ||
| declare function bar(): { x: number }; | ||
| class Base { get y(): number { return 0; } set y(v: number) {} } | ||
| export class C extends Base { | ||
| z = 0; | ||
| a = { p: (this.z = foo()) }; | ||
| b = { p: (super.y = foo()) }; | ||
| c = { p: (bar().x = foo()) }; | ||
| } | ||
| export const d = { p: (bar().x = foo()) }; | ||
|
|
||
|
|
||
|
|
||
|
|
||
| //// [isolatedDeclarationsNonIdentifierAssignmentInference.d.ts] | ||
| declare class Base { | ||
| get y(): number; | ||
| set y(v: number); | ||
| } | ||
| export declare class C extends Base { | ||
| z: number; | ||
| a: { | ||
| p: number; | ||
| }; | ||
| b: { | ||
| p: number; | ||
| }; | ||
| c: { | ||
| p: number; | ||
| }; | ||
| } | ||
| export declare const d: { | ||
| p: number; | ||
| }; | ||
| export {}; |
55 changes: 55 additions & 0 deletions
55
.../isolatedDeclarationsNonIdentifierAssignmentInference(isolateddeclarations=false).symbols
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,55 @@ | ||
| //// [tests/cases/compiler/isolatedDeclarationsNonIdentifierAssignmentInference.ts] //// | ||
|
|
||
| === isolatedDeclarationsNonIdentifierAssignmentInference.ts === | ||
| declare function foo(): number; | ||
| >foo : Symbol(foo, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 0)) | ||
|
|
||
| declare function bar(): { x: number }; | ||
| >bar : Symbol(bar, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 31)) | ||
| >x : Symbol(x, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 25)) | ||
|
|
||
| class Base { get y(): number { return 0; } set y(v: number) {} } | ||
| >Base : Symbol(Base, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 38)) | ||
| >y : Symbol(Base.y, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 12), Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 42)) | ||
| >y : Symbol(Base.y, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 12), Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 42)) | ||
| >v : Symbol(v, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 49)) | ||
|
|
||
| export class C extends Base { | ||
| >C : Symbol(C, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 64)) | ||
| >Base : Symbol(Base, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 38)) | ||
|
|
||
| z = 0; | ||
| >z : Symbol(C.z, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 3, 29)) | ||
|
|
||
| a = { p: (this.z = foo()) }; | ||
| >a : Symbol(C.a, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 4, 10)) | ||
| >p : Symbol(p, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 5, 9)) | ||
| >this.z : Symbol(C.z, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 3, 29)) | ||
| >this : Symbol(C, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 64)) | ||
| >z : Symbol(C.z, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 3, 29)) | ||
| >foo : Symbol(foo, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 0)) | ||
|
|
||
| b = { p: (super.y = foo()) }; | ||
| >b : Symbol(C.b, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 5, 32)) | ||
| >p : Symbol(p, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 6, 9)) | ||
| >super.y : Symbol(Base.y, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 12), Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 42)) | ||
| >super : Symbol(Base, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 38)) | ||
| >y : Symbol(Base.y, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 12), Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 42)) | ||
| >foo : Symbol(foo, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 0)) | ||
|
|
||
| c = { p: (bar().x = foo()) }; | ||
| >c : Symbol(C.c, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 6, 33)) | ||
| >p : Symbol(p, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 7, 9)) | ||
| >bar().x : Symbol(x, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 25)) | ||
| >bar : Symbol(bar, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 31)) | ||
| >x : Symbol(x, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 25)) | ||
| >foo : Symbol(foo, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 0)) | ||
| } | ||
| export const d = { p: (bar().x = foo()) }; | ||
| >d : Symbol(d, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 9, 12)) | ||
| >p : Symbol(p, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 9, 18)) | ||
| >bar().x : Symbol(x, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 25)) | ||
| >bar : Symbol(bar, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 31)) | ||
| >x : Symbol(x, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 25)) | ||
| >foo : Symbol(foo, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 0)) | ||
|
|
75 changes: 75 additions & 0 deletions
75
...er/isolatedDeclarationsNonIdentifierAssignmentInference(isolateddeclarations=false).types
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,75 @@ | ||
| //// [tests/cases/compiler/isolatedDeclarationsNonIdentifierAssignmentInference.ts] //// | ||
|
|
||
| === isolatedDeclarationsNonIdentifierAssignmentInference.ts === | ||
| declare function foo(): number; | ||
| >foo : () => number | ||
|
|
||
| declare function bar(): { x: number }; | ||
| >bar : () => { x: number; } | ||
| >x : number | ||
|
|
||
| class Base { get y(): number { return 0; } set y(v: number) {} } | ||
| >Base : Base | ||
| >y : number | ||
| >0 : 0 | ||
| >y : number | ||
| >v : number | ||
|
|
||
| export class C extends Base { | ||
| >C : C | ||
| >Base : Base | ||
|
|
||
| z = 0; | ||
| >z : number | ||
| >0 : 0 | ||
|
|
||
| a = { p: (this.z = foo()) }; | ||
| >a : { p: number; } | ||
| >{ p: (this.z = foo()) } : { p: number; } | ||
| >p : number | ||
| >(this.z = foo()) : number | ||
| >this.z = foo() : number | ||
| >this.z : number | ||
| >this : this | ||
| >z : number | ||
| >foo() : number | ||
| >foo : () => number | ||
|
|
||
| b = { p: (super.y = foo()) }; | ||
| >b : { p: number; } | ||
| >{ p: (super.y = foo()) } : { p: number; } | ||
| >p : number | ||
| >(super.y = foo()) : number | ||
| >super.y = foo() : number | ||
| >super.y : number | ||
| >super : Base | ||
| >y : number | ||
| >foo() : number | ||
| >foo : () => number | ||
|
|
||
| c = { p: (bar().x = foo()) }; | ||
| >c : { p: number; } | ||
| >{ p: (bar().x = foo()) } : { p: number; } | ||
| >p : number | ||
| >(bar().x = foo()) : number | ||
| >bar().x = foo() : number | ||
| >bar().x : number | ||
| >bar() : { x: number; } | ||
| >bar : () => { x: number; } | ||
| >x : number | ||
| >foo() : number | ||
| >foo : () => number | ||
| } | ||
| export const d = { p: (bar().x = foo()) }; | ||
| >d : { p: number; } | ||
| >{ p: (bar().x = foo()) } : { p: number; } | ||
| >p : number | ||
| >(bar().x = foo()) : number | ||
| >bar().x = foo() : number | ||
| >bar().x : number | ||
| >bar() : { x: number; } | ||
| >bar : () => { x: number; } | ||
| >x : number | ||
| >foo() : number | ||
| >foo : () => number | ||
|
|
34 changes: 34 additions & 0 deletions
34
...solatedDeclarationsNonIdentifierAssignmentInference(isolateddeclarations=true).errors.txt
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,34 @@ | ||
| isolatedDeclarationsNonIdentifierAssignmentInference.ts(6,15): error TS9013: Expression type can't be inferred with --isolatedDeclarations. | ||
| isolatedDeclarationsNonIdentifierAssignmentInference.ts(7,15): error TS9013: Expression type can't be inferred with --isolatedDeclarations. | ||
| isolatedDeclarationsNonIdentifierAssignmentInference.ts(8,15): error TS9013: Expression type can't be inferred with --isolatedDeclarations. | ||
| isolatedDeclarationsNonIdentifierAssignmentInference.ts(10,24): error TS9013: Expression type can't be inferred with --isolatedDeclarations. | ||
|
|
||
|
|
||
| ==== isolatedDeclarationsNonIdentifierAssignmentInference.ts (4 errors) ==== | ||
| declare function foo(): number; | ||
| declare function bar(): { x: number }; | ||
| class Base { get y(): number { return 0; } set y(v: number) {} } | ||
| export class C extends Base { | ||
| z = 0; | ||
| a = { p: (this.z = foo()) }; | ||
| ~~~~~~~~~~~~~~ | ||
| !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. | ||
| !!! related TS9029 isolatedDeclarationsNonIdentifierAssignmentInference.ts:6:5: Add a type annotation to the property a. | ||
| !!! related TS9035 isolatedDeclarationsNonIdentifierAssignmentInference.ts:6:15: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. | ||
| b = { p: (super.y = foo()) }; | ||
| ~~~~~~~~~~~~~~~ | ||
| !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. | ||
| !!! related TS9029 isolatedDeclarationsNonIdentifierAssignmentInference.ts:7:5: Add a type annotation to the property b. | ||
| !!! related TS9035 isolatedDeclarationsNonIdentifierAssignmentInference.ts:7:15: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. | ||
| c = { p: (bar().x = foo()) }; | ||
| ~~~~~~~~~~~~~~~ | ||
| !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. | ||
| !!! related TS9029 isolatedDeclarationsNonIdentifierAssignmentInference.ts:8:5: Add a type annotation to the property c. | ||
| !!! related TS9035 isolatedDeclarationsNonIdentifierAssignmentInference.ts:8:15: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. | ||
| } | ||
| export const d = { p: (bar().x = foo()) }; | ||
| ~~~~~~~~~~~~~~~ | ||
| !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. | ||
| !!! related TS9027 isolatedDeclarationsNonIdentifierAssignmentInference.ts:10:14: Add a type annotation to the variable d. | ||
| !!! related TS9035 isolatedDeclarationsNonIdentifierAssignmentInference.ts:10:24: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. | ||
|
|
55 changes: 55 additions & 0 deletions
55
...r/isolatedDeclarationsNonIdentifierAssignmentInference(isolateddeclarations=true).symbols
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,55 @@ | ||
| //// [tests/cases/compiler/isolatedDeclarationsNonIdentifierAssignmentInference.ts] //// | ||
|
|
||
| === isolatedDeclarationsNonIdentifierAssignmentInference.ts === | ||
| declare function foo(): number; | ||
| >foo : Symbol(foo, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 0)) | ||
|
|
||
| declare function bar(): { x: number }; | ||
| >bar : Symbol(bar, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 31)) | ||
| >x : Symbol(x, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 25)) | ||
|
|
||
| class Base { get y(): number { return 0; } set y(v: number) {} } | ||
| >Base : Symbol(Base, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 38)) | ||
| >y : Symbol(Base.y, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 12), Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 42)) | ||
| >y : Symbol(Base.y, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 12), Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 42)) | ||
| >v : Symbol(v, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 49)) | ||
|
|
||
| export class C extends Base { | ||
| >C : Symbol(C, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 64)) | ||
| >Base : Symbol(Base, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 38)) | ||
|
|
||
| z = 0; | ||
| >z : Symbol(C.z, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 3, 29)) | ||
|
|
||
| a = { p: (this.z = foo()) }; | ||
| >a : Symbol(C.a, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 4, 10)) | ||
| >p : Symbol(p, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 5, 9)) | ||
| >this.z : Symbol(C.z, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 3, 29)) | ||
| >this : Symbol(C, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 64)) | ||
| >z : Symbol(C.z, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 3, 29)) | ||
| >foo : Symbol(foo, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 0)) | ||
|
|
||
| b = { p: (super.y = foo()) }; | ||
| >b : Symbol(C.b, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 5, 32)) | ||
| >p : Symbol(p, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 6, 9)) | ||
| >super.y : Symbol(Base.y, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 12), Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 42)) | ||
| >super : Symbol(Base, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 38)) | ||
| >y : Symbol(Base.y, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 12), Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 2, 42)) | ||
| >foo : Symbol(foo, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 0)) | ||
|
|
||
| c = { p: (bar().x = foo()) }; | ||
| >c : Symbol(C.c, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 6, 33)) | ||
| >p : Symbol(p, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 7, 9)) | ||
| >bar().x : Symbol(x, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 25)) | ||
| >bar : Symbol(bar, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 31)) | ||
| >x : Symbol(x, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 25)) | ||
| >foo : Symbol(foo, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 0)) | ||
| } | ||
| export const d = { p: (bar().x = foo()) }; | ||
| >d : Symbol(d, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 9, 12)) | ||
| >p : Symbol(p, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 9, 18)) | ||
| >bar().x : Symbol(x, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 25)) | ||
| >bar : Symbol(bar, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 31)) | ||
| >x : Symbol(x, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 1, 25)) | ||
| >foo : Symbol(foo, Decl(isolatedDeclarationsNonIdentifierAssignmentInference.ts, 0, 0)) | ||
|
|
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.
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.
With
isolatedDeclarationson, if a type can't be inferred, the Go declaration emitter reports an error. Before reporting, it checks if the node is inside an expando assignment likef.x = …, so it doesn't report the same problem twice. This check (isBoundExpando) treated everya.b = …assignment as rooted at a name and passed that root to name lookup.But with
this.x = foo()the root is thethiskeyword, not a name, so the lookup'sNode.Text()would just panic.