changed messages text in checkAndReportErrorForMissingPrefix

This commit is contained in:
shyyko.serhiy@gmail.com 2016-01-14 01:14:33 +02:00
parent 05b1dffc88
commit 21baedfeba
11 changed files with 38 additions and 38 deletions

View File

@ -793,7 +793,7 @@ namespace ts {
if (location.flags & NodeFlags.Static) {
classType = getTypeOfSymbol(symbol);
if (getPropertyOfType(classType, name)) {
error(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_to_prefix_the_static_member_with_the_class_name_1_0, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg), symbolToString(symbol));
error(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg), symbolToString(symbol));
return true;
}
}
@ -801,7 +801,7 @@ namespace ts {
if (location === container) {
classType = (<InterfaceType>getDeclaredTypeOfSymbol(symbol)).thisType;
if (getPropertyOfType(classType, name)) {
error(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_to_prefix_the_object_member_with_this_this_0, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg));
error(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg));
return true;
}
}

View File

@ -1775,11 +1775,11 @@
"category": "Error",
"code": 2661
},
"Cannot find name '{0}'. Did you mean to prefix the static member with the class name, '{1}.{0}'?": {
"Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?": {
"category": "Error",
"code": 2662
},
"Cannot find name '{0}'. Did you mean to prefix the object member with 'this', 'this.{0}'?": {
"Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?": {
"category": "Error",
"code": 2663
},

View File

@ -1,5 +1,5 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(2,3): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(3,11): error TS2663: Cannot find name 'foo'. Did you mean to prefix the object member with 'this', 'this.foo'?
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(3,11): error TS2663: Cannot find name 'foo'. Did you mean the instance member 'this.foo'?
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts (2 errors) ====
@ -9,6 +9,6 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(3,11): err
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
yield(foo);
~~~
!!! error TS2663: Cannot find name 'foo'. Did you mean to prefix the object member with 'this', 'this.foo'?
!!! error TS2663: Cannot find name 'foo'. Did you mean the instance member 'this.foo'?
}
}

View File

@ -1,9 +1,9 @@
tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(4,9): error TS2304: Cannot find name 'x'.
tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(5,15): error TS2304: Cannot find name 'x'.
tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(10,9): error TS2663: Cannot find name 'x'. Did you mean to prefix the object member with 'this', 'this.x'?
tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(10,9): error TS2663: Cannot find name 'x'. Did you mean the instance member 'this.x'?
tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(11,15): error TS2304: Cannot find name 'x'.
tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(17,15): error TS1003: Identifier expected.
tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(23,9): error TS2663: Cannot find name 'x'. Did you mean to prefix the object member with 'this', 'this.x'?
tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(23,9): error TS2663: Cannot find name 'x'. Did you mean the instance member 'this.x'?
==== tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts (6 errors) ====
@ -22,7 +22,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencin
class D {
a = x; // error
~
!!! error TS2663: Cannot find name 'x'. Did you mean to prefix the object member with 'this', 'this.x'?
!!! error TS2663: Cannot find name 'x'. Did you mean the instance member 'this.x'?
b: typeof x; // error
~
!!! error TS2304: Cannot find name 'x'.
@ -41,6 +41,6 @@ tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencin
a = this.x; // ok
b = x; // error
~
!!! error TS2663: Cannot find name 'x'. Did you mean to prefix the object member with 'this', 'this.x'?
!!! error TS2663: Cannot find name 'x'. Did you mean the instance member 'this.x'?
constructor(public x: T) { }
}

View File

@ -7,11 +7,11 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(25,17): er
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(43,19): error TS2304: Cannot find name 'require'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(44,14): error TS2304: Cannot find name 'require'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(341,13): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean to prefix the static member with the class name, 'Runnable.errorHandlerStack'?
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(347,13): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean to prefix the static member with the class name, 'Runnable.errorHandlerStack'?
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(351,17): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean to prefix the static member with the class name, 'Runnable.errorHandlerStack'?
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(354,17): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean to prefix the static member with the class name, 'Runnable.errorHandlerStack'?
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(354,35): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean to prefix the static member with the class name, 'Runnable.errorHandlerStack'?
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(341,13): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'?
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(347,13): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'?
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(351,17): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'?
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(354,17): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'?
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(354,35): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'?
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(691,50): error TS2304: Cannot find name 'ITextWriter'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(716,47): error TS2503: Cannot find namespace 'TypeScript'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(721,62): error TS2304: Cannot find name 'ITextWriter'.
@ -471,7 +471,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32):
static pushGlobalErrorHandler(done: IDone) {
errorHandlerStack.push(function (e) {
~~~~~~~~~~~~~~~~~
!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean to prefix the static member with the class name, 'Runnable.errorHandlerStack'?
!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'?
done(e);
});
}
@ -479,20 +479,20 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32):
static popGlobalErrorHandler() {
errorHandlerStack.pop();
~~~~~~~~~~~~~~~~~
!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean to prefix the static member with the class name, 'Runnable.errorHandlerStack'?
!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'?
}
static handleError(e: Error) {
if (errorHandlerStack.length === 0) {
~~~~~~~~~~~~~~~~~
!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean to prefix the static member with the class name, 'Runnable.errorHandlerStack'?
!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'?
IO.printLine('Global error: ' + e);
} else {
errorHandlerStack[errorHandlerStack.length - 1](e);
~~~~~~~~~~~~~~~~~
!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean to prefix the static member with the class name, 'Runnable.errorHandlerStack'?
!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'?
~~~~~~~~~~~~~~~~~
!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean to prefix the static member with the class name, 'Runnable.errorHandlerStack'?
!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'?
}
}
}

View File

@ -28,7 +28,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(152,63):
tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(153,30): error TS2304: Cannot find name 'List_TextEditInfo'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(155,32): error TS2304: Cannot find name 'AuthorTokenKind'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(182,79): error TS2503: Cannot find namespace 'Services'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(183,20): error TS2662: Cannot find name 'GetIndentSizeFromText'. Did you mean to prefix the static member with the class name, 'Indenter.GetIndentSizeFromText'?
tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(183,20): error TS2662: Cannot find name 'GetIndentSizeFromText'. Did you mean the static member 'Indenter.GetIndentSizeFromText'?
tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(186,67): error TS2503: Cannot find namespace 'Services'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(207,50): error TS2304: Cannot find name 'TokenSpan'.
tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(207,67): error TS2304: Cannot find name 'ParseNode'.
@ -373,7 +373,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(736,38):
!!! error TS2503: Cannot find namespace 'Services'.
return GetIndentSizeFromText(indentText, editorOptions, /*includeNonIndentChars:*/ false);
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2662: Cannot find name 'GetIndentSizeFromText'. Did you mean to prefix the static member with the class name, 'Indenter.GetIndentSizeFromText'?
!!! error TS2662: Cannot find name 'GetIndentSizeFromText'. Did you mean the static member 'Indenter.GetIndentSizeFromText'?
}
static GetIndentSizeFromText(text: string, editorOptions: Services.EditorOptions, includeNonIndentChars: boolean): number {

View File

@ -1,6 +1,6 @@
tests/cases/compiler/recursiveClassReferenceTest.ts(16,19): error TS2304: Cannot find name 'Element'.
tests/cases/compiler/recursiveClassReferenceTest.ts(56,11): error TS2663: Cannot find name 'domNode'. Did you mean to prefix the object member with 'this', 'this.domNode'?
tests/cases/compiler/recursiveClassReferenceTest.ts(88,36): error TS2663: Cannot find name 'mode'. Did you mean to prefix the object member with 'this', 'this.mode'?
tests/cases/compiler/recursiveClassReferenceTest.ts(56,11): error TS2663: Cannot find name 'domNode'. Did you mean the instance member 'this.domNode'?
tests/cases/compiler/recursiveClassReferenceTest.ts(88,36): error TS2663: Cannot find name 'mode'. Did you mean the instance member 'this.mode'?
tests/cases/compiler/recursiveClassReferenceTest.ts(95,21): error TS2345: Argument of type 'Window' is not assignable to parameter of type 'IMode'.
Property 'getInitialState' is missing in type 'Window'.
@ -65,7 +65,7 @@ tests/cases/compiler/recursiveClassReferenceTest.ts(95,21): error TS2345: Argume
public getDomNode() {
return domNode;
~~~~~~~
!!! error TS2663: Cannot find name 'domNode'. Did you mean to prefix the object member with 'this', 'this.domNode'?
!!! error TS2663: Cannot find name 'domNode'. Did you mean the instance member 'this.domNode'?
}
public destroy() {
@ -99,7 +99,7 @@ tests/cases/compiler/recursiveClassReferenceTest.ts(95,21): error TS2345: Argume
public getMode(): IMode { return mode; }
~~~~
!!! error TS2663: Cannot find name 'mode'. Did you mean to prefix the object member with 'this', 'this.mode'?
!!! error TS2663: Cannot find name 'mode'. Did you mean the instance member 'this.mode'?
}
export class Mode extends AbstractMode {

View File

@ -1,14 +1,14 @@
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(1,1): error TS6053: File 'tests/cases/conformance/scanner/ecmascript5/References.ts' not found.
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(5,21): error TS2304: Cannot find name 'CharacterCodes'.
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(5,47): error TS2304: Cannot find name 'CharacterCodes'.
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(9,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean to prefix the static member with the class name, 'CharacterInfo.isDecimalDigit'?
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(9,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'?
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(10,22): error TS2304: Cannot find name 'CharacterCodes'.
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(10,47): error TS2304: Cannot find name 'CharacterCodes'.
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(11,22): error TS2304: Cannot find name 'CharacterCodes'.
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(11,47): error TS2304: Cannot find name 'CharacterCodes'.
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(15,9): error TS2304: Cannot find name 'Debug'.
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(15,22): error TS2662: Cannot find name 'isHexDigit'. Did you mean to prefix the static member with the class name, 'CharacterInfo.isHexDigit'?
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(16,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean to prefix the static member with the class name, 'CharacterInfo.isDecimalDigit'?
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(15,22): error TS2662: Cannot find name 'isHexDigit'. Did you mean the static member 'CharacterInfo.isHexDigit'?
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(16,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'?
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(17,20): error TS2304: Cannot find name 'CharacterCodes'.
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(18,21): error TS2304: Cannot find name 'CharacterCodes'.
tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(18,46): error TS2304: Cannot find name 'CharacterCodes'.
@ -33,7 +33,7 @@ tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(20,23): error TS2304
public static isHexDigit(c: number): boolean {
return isDecimalDigit(c) ||
~~~~~~~~~~~~~~
!!! error TS2662: Cannot find name 'isDecimalDigit'. Did you mean to prefix the static member with the class name, 'CharacterInfo.isDecimalDigit'?
!!! error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'?
(c >= CharacterCodes.A && c <= CharacterCodes.F) ||
~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'CharacterCodes'.
@ -51,10 +51,10 @@ tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(20,23): error TS2304
~~~~~
!!! error TS2304: Cannot find name 'Debug'.
~~~~~~~~~~
!!! error TS2662: Cannot find name 'isHexDigit'. Did you mean to prefix the static member with the class name, 'CharacterInfo.isHexDigit'?
!!! error TS2662: Cannot find name 'isHexDigit'. Did you mean the static member 'CharacterInfo.isHexDigit'?
return isDecimalDigit(c)
~~~~~~~~~~~~~~
!!! error TS2662: Cannot find name 'isDecimalDigit'. Did you mean to prefix the static member with the class name, 'CharacterInfo.isDecimalDigit'?
!!! error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'?
? (c - CharacterCodes._0)
~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'CharacterCodes'.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/scopeCheckExtendedClassInsidePublicMethod2.ts(4,7): error TS2663: Cannot find name 'v'. Did you mean to prefix the object member with 'this', 'this.v'?
tests/cases/compiler/scopeCheckExtendedClassInsidePublicMethod2.ts(4,7): error TS2663: Cannot find name 'v'. Did you mean the instance member 'this.v'?
tests/cases/compiler/scopeCheckExtendedClassInsidePublicMethod2.ts(6,7): error TS2304: Cannot find name 's'.
@ -8,7 +8,7 @@ tests/cases/compiler/scopeCheckExtendedClassInsidePublicMethod2.ts(6,7): error T
public c() {
v = 1;
~
!!! error TS2663: Cannot find name 'v'. Did you mean to prefix the object member with 'this', 'this.v'?
!!! error TS2663: Cannot find name 'v'. Did you mean the instance member 'this.v'?
this.p = 1;
s = 1;
~

View File

@ -1,6 +1,6 @@
tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts(4,7): error TS2304: Cannot find name 'v'.
tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts(5,12): error TS2339: Property 'p' does not exist on type 'typeof D'.
tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts(6,7): error TS2662: Cannot find name 's'. Did you mean to prefix the static member with the class name, 'D.s'?
tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts(6,7): error TS2662: Cannot find name 's'. Did you mean the static member 'D.s'?
==== tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts (3 errors) ====
@ -15,6 +15,6 @@ tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts(6,7): error T
!!! error TS2339: Property 'p' does not exist on type 'typeof D'.
s = 1;
~
!!! error TS2662: Cannot find name 's'. Did you mean to prefix the static member with the class name, 'D.s'?
!!! error TS2662: Cannot find name 's'. Did you mean the static member 'D.s'?
}
}

View File

@ -1,4 +1,4 @@
tests/cases/compiler/unqualifiedCallToClassStatic1.ts(4,3): error TS2662: Cannot find name 'foo'. Did you mean to prefix the static member with the class name, 'Vector.foo'?
tests/cases/compiler/unqualifiedCallToClassStatic1.ts(4,3): error TS2662: Cannot find name 'foo'. Did you mean the static member 'Vector.foo'?
==== tests/cases/compiler/unqualifiedCallToClassStatic1.ts (1 errors) ====
@ -7,6 +7,6 @@ tests/cases/compiler/unqualifiedCallToClassStatic1.ts(4,3): error TS2662: Cannot
// 'foo' cannot be called in an unqualified manner.
foo();
~~~
!!! error TS2662: Cannot find name 'foo'. Did you mean to prefix the static member with the class name, 'Vector.foo'?
!!! error TS2662: Cannot find name 'foo'. Did you mean the static member 'Vector.foo'?
}
}