mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Skip arrow functions in checkAndReportErrorForMissingPrefix (#23584)
This commit is contained in:
parent
5c94bef0e1
commit
699ea246ff
@ -1568,7 +1568,7 @@ namespace ts {
|
||||
return false;
|
||||
}
|
||||
|
||||
const container = getThisContainer(errorLocation, /*includeArrowFunctions*/ true);
|
||||
const container = getThisContainer(errorLocation, /*includeArrowFunctions*/ false);
|
||||
let location = container;
|
||||
while (location) {
|
||||
if (isClassLike(location.parent)) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(8,21): error TS2304: Cannot find name 'field1'.
|
||||
tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(8,21): error TS2663: Cannot find name 'field1'. Did you mean the instance member 'this.field1'?
|
||||
|
||||
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts (0 errors) ====
|
||||
@ -14,6 +14,6 @@ tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(8,21): error T
|
||||
messageHandler = () => {
|
||||
console.log(field1); // Should be error that couldnt find symbol field1
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'field1'.
|
||||
!!! error TS2663: Cannot find name 'field1'. Did you mean the instance member 'this.field1'?
|
||||
};
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user