diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1008c411474c0..44ff0561779dd 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1236,6 +1236,10 @@ namespace ts { function checkAndReportErrorForUsingTypeAsValue(errorLocation: Node, name: string, meaning: SymbolFlags): boolean { if (meaning & (SymbolFlags.Value & ~SymbolFlags.NamespaceModule)) { + if (name === "any" || name === "string" || name === "number" || name === "boolean" || name === "void" || name === "never") { + error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, name); + return true; + } const symbol = resolveSymbol(resolveName(errorLocation, name, SymbolFlags.Type & ~SymbolFlags.Value, /*nameNotFoundMessage*/undefined, /*nameArg*/ undefined)); if (symbol && !(symbol.flags & SymbolFlags.NamespaceModule)) { error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, name); diff --git a/tests/baselines/reference/autoLift2.errors.txt b/tests/baselines/reference/autoLift2.errors.txt index 1111a3750d82e..4e07c1c92f5f2 100644 --- a/tests/baselines/reference/autoLift2.errors.txt +++ b/tests/baselines/reference/autoLift2.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/autoLift2.ts(5,14): error TS2339: Property 'foo' does not exist on type 'A'. tests/cases/compiler/autoLift2.ts(5,17): error TS1005: ';' expected. -tests/cases/compiler/autoLift2.ts(5,19): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +tests/cases/compiler/autoLift2.ts(5,19): error TS2693: 'any' only refers to a type, but is being used as a value here. tests/cases/compiler/autoLift2.ts(6,14): error TS2551: Property 'bar' does not exist on type 'A'. Did you mean 'baz'? tests/cases/compiler/autoLift2.ts(6,17): error TS1005: ';' expected. -tests/cases/compiler/autoLift2.ts(6,19): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +tests/cases/compiler/autoLift2.ts(6,19): error TS2693: 'any' only refers to a type, but is being used as a value here. tests/cases/compiler/autoLift2.ts(12,11): error TS2339: Property 'foo' does not exist on type 'A'. tests/cases/compiler/autoLift2.ts(14,11): error TS2551: Property 'bar' does not exist on type 'A'. Did you mean 'baz'? tests/cases/compiler/autoLift2.ts(16,33): error TS2339: Property 'foo' does not exist on type 'A'. @@ -21,14 +21,14 @@ tests/cases/compiler/autoLift2.ts(18,33): error TS2551: Property 'bar' does not ~ !!! error TS1005: ';' expected. ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. this.bar: any; ~~~ !!! error TS2551: Property 'bar' does not exist on type 'A'. Did you mean 'baz'? ~ !!! error TS1005: ';' expected. ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. } diff --git a/tests/baselines/reference/badArrayIndex.errors.txt b/tests/baselines/reference/badArrayIndex.errors.txt index 12aec4d45f413..decfebeeac712 100644 --- a/tests/baselines/reference/badArrayIndex.errors.txt +++ b/tests/baselines/reference/badArrayIndex.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/badArrayIndex.ts(1,15): error TS2552: Cannot find name 'number'. Did you mean 'Number'? +tests/cases/compiler/badArrayIndex.ts(1,15): error TS2693: 'number' only refers to a type, but is being used as a value here. tests/cases/compiler/badArrayIndex.ts(1,22): error TS1109: Expression expected. ==== tests/cases/compiler/badArrayIndex.ts (2 errors) ==== var results = number[]; ~~~~~~ -!!! error TS2552: Cannot find name 'number'. Did you mean 'Number'? +!!! error TS2693: 'number' only refers to a type, but is being used as a value here. ~ !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/bases.errors.txt b/tests/baselines/reference/bases.errors.txt index 974d5accfc457..3069f977fe12c 100644 --- a/tests/baselines/reference/bases.errors.txt +++ b/tests/baselines/reference/bases.errors.txt @@ -1,13 +1,13 @@ tests/cases/compiler/bases.ts(7,14): error TS2339: Property 'y' does not exist on type 'B'. tests/cases/compiler/bases.ts(7,15): error TS1005: ';' expected. -tests/cases/compiler/bases.ts(7,17): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +tests/cases/compiler/bases.ts(7,17): error TS2693: 'any' only refers to a type, but is being used as a value here. tests/cases/compiler/bases.ts(11,7): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'x' is missing in type 'C'. tests/cases/compiler/bases.ts(12,5): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/compiler/bases.ts(13,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/bases.ts(13,14): error TS2339: Property 'x' does not exist on type 'C'. tests/cases/compiler/bases.ts(13,15): error TS1005: ';' expected. -tests/cases/compiler/bases.ts(13,17): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +tests/cases/compiler/bases.ts(13,17): error TS2693: 'any' only refers to a type, but is being used as a value here. tests/cases/compiler/bases.ts(17,9): error TS2339: Property 'x' does not exist on type 'C'. tests/cases/compiler/bases.ts(18,9): error TS2339: Property 'y' does not exist on type 'C'. @@ -25,7 +25,7 @@ tests/cases/compiler/bases.ts(18,9): error TS2339: Property 'y' does not exist o ~ !!! error TS1005: ';' expected. ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. } } @@ -44,7 +44,7 @@ tests/cases/compiler/bases.ts(18,9): error TS2339: Property 'y' does not exist o ~ !!! error TS1005: ';' expected. ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. } ~~~~~ !!! error TS2377: Constructors for derived classes must contain a 'super' call. diff --git a/tests/baselines/reference/cannotInvokeNewOnIndexExpression.errors.txt b/tests/baselines/reference/cannotInvokeNewOnIndexExpression.errors.txt index 5e1b869c05733..dbd10d775d98e 100644 --- a/tests/baselines/reference/cannotInvokeNewOnIndexExpression.errors.txt +++ b/tests/baselines/reference/cannotInvokeNewOnIndexExpression.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/cannotInvokeNewOnIndexExpression.ts(1,23): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +tests/cases/compiler/cannotInvokeNewOnIndexExpression.ts(1,23): error TS2693: 'any' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/cannotInvokeNewOnIndexExpression.ts (1 errors) ==== var test: any[] = new any[1]; ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? \ No newline at end of file +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingPrimitive.errors.txt b/tests/baselines/reference/classExtendingPrimitive.errors.txt index fc2e5bd5ad785..32a3e68cb3ef5 100644 --- a/tests/baselines/reference/classExtendingPrimitive.errors.txt +++ b/tests/baselines/reference/classExtendingPrimitive.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(3,17): error TS2552: Cannot find name 'number'. Did you mean 'Number'? -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(4,18): error TS2552: Cannot find name 'string'. Did you mean 'String'? -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(5,18): error TS2552: Cannot find name 'boolean'. Did you mean 'Boolean'? +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(3,17): error TS2693: 'number' only refers to a type, but is being used as a value here. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(4,18): error TS2693: 'string' only refers to a type, but is being used as a value here. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(5,18): error TS2693: 'boolean' only refers to a type, but is being used as a value here. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(6,18): error TS2304: Cannot find name 'Void'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1109: Expression expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(8,18): error TS2304: Cannot find name 'Null'. @@ -14,13 +14,13 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla class C extends number { } ~~~~~~ -!!! error TS2552: Cannot find name 'number'. Did you mean 'Number'? +!!! error TS2693: 'number' only refers to a type, but is being used as a value here. class C2 extends string { } ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. class C3 extends boolean { } ~~~~~~~ -!!! error TS2552: Cannot find name 'boolean'. Did you mean 'Boolean'? +!!! error TS2693: 'boolean' only refers to a type, but is being used as a value here. class C4 extends Void { } ~~~~ !!! error TS2304: Cannot find name 'Void'. diff --git a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt index 7c624b3b2841d..b4e8aa7360ec0 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(4,17): error TS2689: Cannot extend an interface 'I'. Did you mean 'implements'? tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,18): error TS2507: Type '{ foo: any; }' is not a constructor function type. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,25): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,25): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,31): error TS1005: ',' expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(8,18): error TS2507: Type '{ foo: string; }' is not a constructor function type. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(11,18): error TS2507: Type 'typeof M' is not a constructor function type. @@ -20,7 +20,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla ~~~~~~~~~~~~~~~~ !!! error TS2507: Type '{ foo: any; }' is not a constructor function type. ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ',' expected. var x: { foo: string; } diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt index e92761884ea2c..bbaac16658220 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,18): error TS2507: Type '{ foo: any; }' is not a constructor function type. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,25): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,25): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,31): error TS1005: ',' expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS2507: Type 'undefined[]' is not a constructor function type. @@ -9,7 +9,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla ~~~~~~~~~~~~~~~~ !!! error TS2507: Type '{ foo: any; }' is not a constructor function type. ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ',' expected. diff --git a/tests/baselines/reference/classMemberWithMissingIdentifier2.errors.txt b/tests/baselines/reference/classMemberWithMissingIdentifier2.errors.txt index d0459214fd1a3..9854a115aa672 100644 --- a/tests/baselines/reference/classMemberWithMissingIdentifier2.errors.txt +++ b/tests/baselines/reference/classMemberWithMissingIdentifier2.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,11): error TS1146: D tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,12): error TS1005: '=' expected. tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,14): error TS2304: Cannot find name 'name'. tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,18): error TS1005: ']' expected. -tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,19): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,19): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,25): error TS1005: ',' expected. tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,26): error TS1136: Property assignment expected. tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,27): error TS2304: Cannot find name 'VariableDeclaration'. @@ -20,7 +20,7 @@ tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,27): error TS2304: C ~ !!! error TS1005: ']' expected. ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ',' expected. ~ diff --git a/tests/baselines/reference/complicatedPrivacy.errors.txt b/tests/baselines/reference/complicatedPrivacy.errors.txt index ccf0b4fa025fb..661b0693807c4 100644 --- a/tests/baselines/reference/complicatedPrivacy.errors.txt +++ b/tests/baselines/reference/complicatedPrivacy.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/complicatedPrivacy.ts(11,24): error TS1054: A 'get' accessor cannot have parameters. tests/cases/compiler/complicatedPrivacy.ts(35,5): error TS1170: A computed property name in a type literal must directly refer to a built-in symbol. -tests/cases/compiler/complicatedPrivacy.ts(35,6): error TS2552: Cannot find name 'number'. Did you mean 'Number'? +tests/cases/compiler/complicatedPrivacy.ts(35,6): error TS2693: 'number' only refers to a type, but is being used as a value here. tests/cases/compiler/complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo5' has no exported member 'i6'. @@ -45,7 +45,7 @@ tests/cases/compiler/complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo ~~~~~~~~ !!! error TS1170: A computed property name in a type literal must directly refer to a built-in symbol. ~~~~~~ -!!! error TS2552: Cannot find name 'number'. Did you mean 'Number'? +!!! error TS2693: 'number' only refers to a type, but is being used as a value here. }) { } diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 1f5610360354d..9a36bb405abc0 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -52,7 +52,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,9): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,16): error TS2304: Cannot find name 'method1'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,24): error TS2552: Cannot find name 'val'. Did you mean 'eval'? tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,27): error TS1005: ',' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,28): error TS2552: Cannot find name 'number'. Did you mean 'Number'? +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,28): error TS2693: 'number' only refers to a type, but is being used as a value here. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,36): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,16): error TS2304: Cannot find name 'method2'. @@ -67,14 +67,14 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,9): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,16): error TS2304: Cannot find name 'Overloads'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,26): error TS2304: Cannot find name 'value'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,31): error TS1005: ',' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,33): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,33): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,16): error TS2304: Cannot find name 'Overloads'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,27): error TS1135: Argument expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS1005: '(' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,35): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,35): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,43): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,52): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,52): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,60): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS2304: Cannot find name 'public'. @@ -82,7 +82,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS2304: Cannot find name 'DefaultValue'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error TS2304: Cannot find name 'value'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,35): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. @@ -435,7 +435,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS ~ !!! error TS1005: ',' expected. ~~~~~~ -!!! error TS2552: Cannot find name 'number'. Did you mean 'Number'? +!!! error TS2693: 'number' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ';' expected. return val; @@ -486,7 +486,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS ~ !!! error TS1005: ',' expected. ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. public Overloads( while : string, ...rest: string[]) { & ~~~~~~ !!! error TS1128: Declaration or statement expected. @@ -497,11 +497,11 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS ~ !!! error TS1005: '(' expected. ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~~~ !!! error TS1109: Expression expected. ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ';' expected. ~ @@ -519,7 +519,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS ~ !!! error TS1109: Expression expected. ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ';' expected. } diff --git a/tests/baselines/reference/createArray.errors.txt b/tests/baselines/reference/createArray.errors.txt index e562abd282cc7..082e8dc03e289 100644 --- a/tests/baselines/reference/createArray.errors.txt +++ b/tests/baselines/reference/createArray.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/createArray.ts(1,12): error TS2552: Cannot find name 'number'. Did you mean 'Number'? +tests/cases/compiler/createArray.ts(1,12): error TS2693: 'number' only refers to a type, but is being used as a value here. tests/cases/compiler/createArray.ts(1,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/createArray.ts(6,6): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/createArray.ts(7,12): error TS2552: Cannot find name 'boolean'. Did you mean 'Boolean'? +tests/cases/compiler/createArray.ts(7,12): error TS2693: 'boolean' only refers to a type, but is being used as a value here. tests/cases/compiler/createArray.ts(7,19): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/createArray.ts(8,12): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/compiler/createArray.ts(8,12): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/compiler/createArray.ts(8,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ==== tests/cases/compiler/createArray.ts (7 errors) ==== var na=new number[]; ~~~~~~ -!!! error TS2552: Cannot find name 'number'. Did you mean 'Number'? +!!! error TS2693: 'number' only refers to a type, but is being used as a value here. ~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. @@ -22,12 +22,12 @@ tests/cases/compiler/createArray.ts(8,18): error TS1150: 'new T[]' cannot be use !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var ba=new boolean[]; ~~~~~~~ -!!! error TS2552: Cannot find name 'boolean'. Did you mean 'Boolean'? +!!! error TS2693: 'boolean' only refers to a type, but is being used as a value here. ~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var sa=new string[]; ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. function f(s:string):number { return 0; diff --git a/tests/baselines/reference/errorLocationForInterfaceExtension.errors.txt b/tests/baselines/reference/errorLocationForInterfaceExtension.errors.txt index f385d0afcb3b4..6ed1517335d24 100644 --- a/tests/baselines/reference/errorLocationForInterfaceExtension.errors.txt +++ b/tests/baselines/reference/errorLocationForInterfaceExtension.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/errorLocationForInterfaceExtension.ts(3,21): error TS2304: Cannot find name 'string'. +tests/cases/compiler/errorLocationForInterfaceExtension.ts(3,21): error TS2693: 'string' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/errorLocationForInterfaceExtension.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/compiler/errorLocationForInterfaceExtension.ts(3,21): error TS2304: interface x extends string { } ~~~~~~ -!!! error TS2304: Cannot find name 'string'. +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. \ No newline at end of file diff --git a/tests/baselines/reference/newExpressionWithCast.errors.txt b/tests/baselines/reference/newExpressionWithCast.errors.txt index 158856f7beb06..5a2e18c585ffa 100644 --- a/tests/baselines/reference/newExpressionWithCast.errors.txt +++ b/tests/baselines/reference/newExpressionWithCast.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/newExpressionWithCast.ts(3,12): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. tests/cases/compiler/newExpressionWithCast.ts(7,13): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'void'. tests/cases/compiler/newExpressionWithCast.ts(7,17): error TS1109: Expression expected. -tests/cases/compiler/newExpressionWithCast.ts(7,18): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +tests/cases/compiler/newExpressionWithCast.ts(7,18): error TS2693: 'any' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/newExpressionWithCast.ts (4 errors) ==== @@ -19,7 +19,7 @@ tests/cases/compiler/newExpressionWithCast.ts(7,18): error TS2552: Cannot find n ~ !!! error TS1109: Expression expected. ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. function Test3() { } // valid with noImplicitAny diff --git a/tests/baselines/reference/newNonReferenceType.errors.txt b/tests/baselines/reference/newNonReferenceType.errors.txt index 4cf478b6e22ce..01824a64f5f48 100644 --- a/tests/baselines/reference/newNonReferenceType.errors.txt +++ b/tests/baselines/reference/newNonReferenceType.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/newNonReferenceType.ts(1,13): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? -tests/cases/compiler/newNonReferenceType.ts(2,13): error TS2552: Cannot find name 'boolean'. Did you mean 'Boolean'? +tests/cases/compiler/newNonReferenceType.ts(1,13): error TS2693: 'any' only refers to a type, but is being used as a value here. +tests/cases/compiler/newNonReferenceType.ts(2,13): error TS2693: 'boolean' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/newNonReferenceType.ts (2 errors) ==== var a = new any(); ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. var b = new boolean(); // error ~~~~~~~ -!!! error TS2552: Cannot find name 'boolean'. Did you mean 'Boolean'? +!!! error TS2693: 'boolean' only refers to a type, but is being used as a value here. \ No newline at end of file diff --git a/tests/baselines/reference/newOperator.errors.txt b/tests/baselines/reference/newOperator.errors.txt index 6c07677acd3fa..ae96023a60b76 100644 --- a/tests/baselines/reference/newOperator.errors.txt +++ b/tests/baselines/reference/newOperator.errors.txt @@ -1,10 +1,10 @@ tests/cases/compiler/newOperator.ts(3,13): error TS2693: 'ifc' only refers to a type, but is being used as a value here. tests/cases/compiler/newOperator.ts(10,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/newOperator.ts(11,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/newOperator.ts(12,5): error TS2552: Cannot find name 'string'. Did you mean 'String'? -tests/cases/compiler/newOperator.ts(18,14): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/compiler/newOperator.ts(12,5): error TS2693: 'string' only refers to a type, but is being used as a value here. +tests/cases/compiler/newOperator.ts(18,14): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/compiler/newOperator.ts(18,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/newOperator.ts(21,1): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/compiler/newOperator.ts(21,1): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/compiler/newOperator.ts(22,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/newOperator.ts(28,13): error TS2304: Cannot find name 'q'. tests/cases/compiler/newOperator.ts(31,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -32,7 +32,7 @@ tests/cases/compiler/newOperator.ts(45,23): error TS1150: 'new T[]' cannot be us !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. new string; ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. // Use in LHS of expression? (new Date()).toString(); @@ -40,14 +40,14 @@ tests/cases/compiler/newOperator.ts(45,23): error TS1150: 'new T[]' cannot be us // Various spacing var t3 = new string[]( ); ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var t4 = new string ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. [ ~ ] diff --git a/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt b/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt index 4aa261d9808ce..cded9c44a3db3 100644 --- a/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt +++ b/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt @@ -5,12 +5,12 @@ tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,3): error TS1128 tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,10): error TS2304: Cannot find name 'test'. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,15): error TS2304: Cannot find name 'name'. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,19): error TS1005: ',' expected. -tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,20): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,20): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,3): error TS1128: Declaration or statement expected. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,10): error TS2304: Cannot find name 'test'. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,15): error TS2304: Cannot find name 'name'. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,20): error TS1109: Expression expected. -tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,21): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,21): error TS2693: 'any' only refers to a type, but is being used as a value here. tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,25): error TS1005: ';' expected. @@ -33,7 +33,7 @@ tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,25): error TS100 ~ !!! error TS1005: ',' expected. ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. static test(name?:any){ } ~~~~~~ !!! error TS1128: Declaration or statement expected. @@ -44,7 +44,7 @@ tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,25): error TS100 ~ !!! error TS1109: Expression expected. ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ';' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/parserRealSource10.errors.txt b/tests/baselines/reference/parserRealSource10.errors.txt index c6ab397d7d7c1..7d65c1690fe57 100644 --- a/tests/baselines/reference/parserRealSource10.errors.txt +++ b/tests/baselines/reference/parserRealSource10.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(127,33): error TS2449: Class 'TokenInfo' used before its declaration. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(127,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,36): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,36): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,41): error TS2552: Cannot find name 'number'. Did you mean 'Number'? +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,41): error TS2693: 'number' only refers to a type, but is being used as a value here. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,47): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,35): error TS2552: Cannot find name 'boolean'. Did you mean 'Boolean'? +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,35): error TS2693: 'boolean' only refers to a type, but is being used as a value here. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(179,54): error TS2304: Cannot find name 'ErrorRecoverySet'. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(184,28): error TS2304: Cannot find name 'ErrorRecoverySet'. @@ -479,17 +479,17 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,40): error !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. export var nodeTypeTable = new string[]; ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. export var nodeTypeToTokTable = new number[]; ~~~~~~ -!!! error TS2552: Cannot find name 'number'. Did you mean 'Number'? +!!! error TS2693: 'number' only refers to a type, but is being used as a value here. ~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. export var noRegexTable = new boolean[]; ~~~~~~~ -!!! error TS2552: Cannot find name 'boolean'. Did you mean 'Boolean'? +!!! error TS2693: 'boolean' only refers to a type, but is being used as a value here. ~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. diff --git a/tests/baselines/reference/parserUnterminatedGeneric2.errors.txt b/tests/baselines/reference/parserUnterminatedGeneric2.errors.txt index 2b663a8cd4fef..e38a548f34c97 100644 --- a/tests/baselines/reference/parserUnterminatedGeneric2.errors.txt +++ b/tests/baselines/reference/parserUnterminatedGeneric2.errors.txt @@ -4,12 +4,12 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGener tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,9): error TS2304: Cannot find name 'assign'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,16): error TS2304: Cannot find name 'context'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,23): error TS1005: ',' expected. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,25): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,25): error TS2693: 'any' only refers to a type, but is being used as a value here. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,30): error TS2304: Cannot find name 'value'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,35): error TS1005: ',' expected. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,37): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,37): error TS2693: 'any' only refers to a type, but is being used as a value here. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,41): error TS1005: ';' expected. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,43): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,43): error TS2693: 'any' only refers to a type, but is being used as a value here. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(8,23): error TS2304: Cannot find name 'IPromise'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(8,45): error TS2304: Cannot find name 'IPromise'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(8,54): error TS1005: '>' expected. @@ -33,17 +33,17 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGener ~ !!! error TS1005: ',' expected. ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. ~~~~~ !!! error TS2304: Cannot find name 'value'. ~ !!! error TS1005: ',' expected. ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ';' expected. ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. } interface IQService { diff --git a/tests/baselines/reference/primitiveTypeAssignment.errors.txt b/tests/baselines/reference/primitiveTypeAssignment.errors.txt index 4048a00150f58..1800e1657e099 100644 --- a/tests/baselines/reference/primitiveTypeAssignment.errors.txt +++ b/tests/baselines/reference/primitiveTypeAssignment.errors.txt @@ -1,18 +1,18 @@ -tests/cases/compiler/primitiveTypeAssignment.ts(1,9): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? -tests/cases/compiler/primitiveTypeAssignment.ts(3,9): error TS2552: Cannot find name 'number'. Did you mean 'Number'? -tests/cases/compiler/primitiveTypeAssignment.ts(5,9): error TS2552: Cannot find name 'boolean'. Did you mean 'Boolean'? +tests/cases/compiler/primitiveTypeAssignment.ts(1,9): error TS2693: 'any' only refers to a type, but is being used as a value here. +tests/cases/compiler/primitiveTypeAssignment.ts(3,9): error TS2693: 'number' only refers to a type, but is being used as a value here. +tests/cases/compiler/primitiveTypeAssignment.ts(5,9): error TS2693: 'boolean' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/primitiveTypeAssignment.ts (3 errors) ==== var x = any; ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. var y = number; ~~~~~~ -!!! error TS2552: Cannot find name 'number'. Did you mean 'Number'? +!!! error TS2693: 'number' only refers to a type, but is being used as a value here. var z = boolean; ~~~~~~~ -!!! error TS2552: Cannot find name 'boolean'. Did you mean 'Boolean'? +!!! error TS2693: 'boolean' only refers to a type, but is being used as a value here. \ No newline at end of file diff --git a/tests/baselines/reference/privateIndexer2.errors.txt b/tests/baselines/reference/privateIndexer2.errors.txt index a12da313ffa73..7e826dbc7a9df 100644 --- a/tests/baselines/reference/privateIndexer2.errors.txt +++ b/tests/baselines/reference/privateIndexer2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/classes/indexMemberDeclarations/privateIndexer2.ts(4,15): error TS1005: ']' expected. -tests/cases/conformance/classes/indexMemberDeclarations/privateIndexer2.ts(4,17): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/conformance/classes/indexMemberDeclarations/privateIndexer2.ts(4,17): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/conformance/classes/indexMemberDeclarations/privateIndexer2.ts(4,23): error TS1005: ',' expected. tests/cases/conformance/classes/indexMemberDeclarations/privateIndexer2.ts(4,24): error TS1136: Property assignment expected. tests/cases/conformance/classes/indexMemberDeclarations/privateIndexer2.ts(4,32): error TS1005: ':' expected. @@ -13,7 +13,7 @@ tests/cases/conformance/classes/indexMemberDeclarations/privateIndexer2.ts(4,32) ~ !!! error TS1005: ']' expected. ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ',' expected. ~ diff --git a/tests/baselines/reference/staticsInAFunction.errors.txt b/tests/baselines/reference/staticsInAFunction.errors.txt index 46636037c9782..254f321913b9f 100644 --- a/tests/baselines/reference/staticsInAFunction.errors.txt +++ b/tests/baselines/reference/staticsInAFunction.errors.txt @@ -5,12 +5,12 @@ tests/cases/compiler/staticsInAFunction.ts(3,4): error TS1128: Declaration or st tests/cases/compiler/staticsInAFunction.ts(3,11): error TS2304: Cannot find name 'test'. tests/cases/compiler/staticsInAFunction.ts(3,16): error TS2304: Cannot find name 'name'. tests/cases/compiler/staticsInAFunction.ts(3,20): error TS1005: ',' expected. -tests/cases/compiler/staticsInAFunction.ts(3,21): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/compiler/staticsInAFunction.ts(3,21): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/compiler/staticsInAFunction.ts(4,4): error TS1128: Declaration or statement expected. tests/cases/compiler/staticsInAFunction.ts(4,11): error TS2304: Cannot find name 'test'. tests/cases/compiler/staticsInAFunction.ts(4,16): error TS2304: Cannot find name 'name'. tests/cases/compiler/staticsInAFunction.ts(4,21): error TS1109: Expression expected. -tests/cases/compiler/staticsInAFunction.ts(4,22): error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +tests/cases/compiler/staticsInAFunction.ts(4,22): error TS2693: 'any' only refers to a type, but is being used as a value here. tests/cases/compiler/staticsInAFunction.ts(4,26): error TS1005: ';' expected. @@ -33,7 +33,7 @@ tests/cases/compiler/staticsInAFunction.ts(4,26): error TS1005: ';' expected. ~ !!! error TS1005: ',' expected. ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. static test(name?:any){} ~~~~~~ !!! error TS1128: Declaration or statement expected. @@ -44,7 +44,7 @@ tests/cases/compiler/staticsInAFunction.ts(4,26): error TS1005: ';' expected. ~ !!! error TS1109: Expression expected. ~~~ -!!! error TS2552: Cannot find name 'any'. Did you mean 'NaN'? +!!! error TS2693: 'any' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ';' expected. } diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt index c136d3dd5734c..a3771839dc5de 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt @@ -91,7 +91,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,30): e tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,32): error TS1138: Parameter declaration expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,39): error TS1005: ';' expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,40): error TS1128: Declaration or statement expected. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,42): error TS2552: Cannot find name 'number'. Did you mean 'Number'? +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,42): error TS2693: 'number' only refers to a type, but is being used as a value here. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,49): error TS1005: ';' expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,1): error TS7027: Unreachable code detected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,29): error TS2304: Cannot find name 'm'. @@ -425,7 +425,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e ~ !!! error TS1128: Declaration or statement expected. ~~~~~~ -!!! error TS2552: Cannot find name 'number'. Did you mean 'Number'? +!!! error TS2693: 'number' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ';' expected. diff --git a/tests/baselines/reference/typeAssertions.errors.txt b/tests/baselines/reference/typeAssertions.errors.txt index bfc4232150551..cdd576e6d8b5a 100644 --- a/tests/baselines/reference/typeAssertions.errors.txt +++ b/tests/baselines/reference/typeAssertions.errors.txt @@ -11,7 +11,7 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,5): erro tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,14): error TS1005: '>' expected. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,14): error TS2304: Cannot find name 'is'. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,17): error TS1005: ')' expected. -tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,17): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,17): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,48): error TS1005: ';' expected. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(45,2): error TS2322: Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -19,7 +19,7 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,32): err tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,41): error TS1005: ')' expected. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,41): error TS2304: Cannot find name 'is'. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,44): error TS1005: ';' expected. -tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,44): error TS2552: Cannot find name 'string'. Did you mean 'String'? +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,44): error TS2693: 'string' only refers to a type, but is being used as a value here. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,50): error TS1005: ';' expected. @@ -91,7 +91,7 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,50): err ~~~~~~ !!! error TS1005: ')' expected. ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ';' expected. str = numOrStr; // Error, no narrowing occurred @@ -110,7 +110,7 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,50): err ~~~~~~ !!! error TS1005: ';' expected. ~~~~~~ -!!! error TS2552: Cannot find name 'string'. Did you mean 'String'? +!!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ';' expected. } diff --git a/tests/baselines/reference/undeclaredVarEmit.errors.txt b/tests/baselines/reference/undeclaredVarEmit.errors.txt index 689360aa89905..bbf508ab005bc 100644 --- a/tests/baselines/reference/undeclaredVarEmit.errors.txt +++ b/tests/baselines/reference/undeclaredVarEmit.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/undeclaredVarEmit.ts(1,1): error TS7028: Unused label. -tests/cases/compiler/undeclaredVarEmit.ts(1,4): error TS2552: Cannot find name 'number'. Did you mean 'Number'? +tests/cases/compiler/undeclaredVarEmit.ts(1,4): error TS2693: 'number' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/undeclaredVarEmit.ts (2 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/undeclaredVarEmit.ts(1,4): error TS2552: Cannot find name ' ~ !!! error TS7028: Unused label. ~~~~~~ -!!! error TS2552: Cannot find name 'number'. Did you mean 'Number'? \ No newline at end of file +!!! error TS2693: 'number' only refers to a type, but is being used as a value here. \ No newline at end of file