diff --git a/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt b/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt index 9fd7043faa6..bcfb27652c9 100644 --- a/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt +++ b/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts(5,9): error TS2304: Cannot find name 'M'. -tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts(7,15): error TS2304: Cannot find name 'M'. +tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts(5,9): error TS2708: Cannot use namespace 'M' as a value here because it has no value export. +tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts(7,15): error TS2708: Cannot use namespace 'M' as a value here because it has no value export. ==== tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts (2 errors) ==== @@ -9,9 +9,9 @@ tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiate var m = M; // Error, not instantiated can not be used as var ~ -!!! error TS2304: Cannot find name 'M'. +!!! error TS2708: Cannot use namespace 'M' as a value here because it has no value export. var x: typeof M; // Error only a namespace ~ -!!! error TS2304: Cannot find name 'M'. +!!! error TS2708: Cannot use namespace 'M' as a value here because it has no value export. \ No newline at end of file diff --git a/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt b/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt index 009d405c0f5..ae56be397fe 100644 --- a/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt +++ b/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/aliasOnMergedModuleInterface_1.ts(5,16): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/aliasOnMergedModuleInterface_1.ts(5,16): error TS2708: Cannot use namespace 'foo' as a value here because it has no value export. ==== tests/cases/compiler/aliasOnMergedModuleInterface_1.ts (1 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/aliasOnMergedModuleInterface_1.ts(5,16): error TS2304: Cann z.bar("hello"); // This should be ok var x: foo.A = foo.bar("hello"); // foo.A should be ok but foo.bar should be error ~~~ -!!! error TS2304: Cannot find name 'foo'. +!!! error TS2708: Cannot use namespace 'foo' as a value here because it has no value export. ==== tests/cases/compiler/aliasOnMergedModuleInterface_0.ts (0 errors) ==== declare module "foo" diff --git a/tests/baselines/reference/assignToModule.errors.txt b/tests/baselines/reference/assignToModule.errors.txt index 26121d72a05..f7abfa90bf7 100644 --- a/tests/baselines/reference/assignToModule.errors.txt +++ b/tests/baselines/reference/assignToModule.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/assignToModule.ts(2,1): error TS2304: Cannot find name 'A'. +tests/cases/compiler/assignToModule.ts(2,1): error TS2708: Cannot use namespace 'A' as a value here because it has no value export. ==== tests/cases/compiler/assignToModule.ts (1 errors) ==== module A {} A = undefined; // invalid LHS ~ -!!! error TS2304: Cannot find name 'A'. \ No newline at end of file +!!! error TS2708: Cannot use namespace 'A' as a value here because it has no value export. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToReferenceTypes.errors.txt b/tests/baselines/reference/assignmentToReferenceTypes.errors.txt index 7e323479d57..8c937e02766 100644 --- a/tests/baselines/reference/assignmentToReferenceTypes.errors.txt +++ b/tests/baselines/reference/assignmentToReferenceTypes.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentToReferenceTypes.ts(5,1): error TS2304: Cannot find name 'M'. +tests/cases/compiler/assignmentToReferenceTypes.ts(5,1): error TS2708: Cannot use namespace 'M' as a value here because it has no value export. tests/cases/compiler/assignmentToReferenceTypes.ts(9,1): error TS2539: Cannot assign to 'C' because it is not a variable. tests/cases/compiler/assignmentToReferenceTypes.ts(13,1): error TS2539: Cannot assign to 'E' because it is not a variable. tests/cases/compiler/assignmentToReferenceTypes.ts(16,1): error TS2539: Cannot assign to 'f' because it is not a variable. @@ -11,7 +11,7 @@ tests/cases/compiler/assignmentToReferenceTypes.ts(16,1): error TS2539: Cannot a } M = null; ~ -!!! error TS2304: Cannot find name 'M'. +!!! error TS2708: Cannot use namespace 'M' as a value here because it has no value export. class C { } diff --git a/tests/baselines/reference/assignments.errors.txt b/tests/baselines/reference/assignments.errors.txt index 86bbe75cd4b..2c3fff0be59 100644 --- a/tests/baselines/reference/assignments.errors.txt +++ b/tests/baselines/reference/assignments.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(11,1): error TS2304: Cannot find name 'M'. +tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(11,1): error TS2708: Cannot use namespace 'M' as a value here because it has no value export. tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(14,1): error TS2539: Cannot assign to 'C' because it is not a variable. tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(17,1): error TS2539: Cannot assign to 'E' because it is not a variable. tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(18,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. @@ -19,7 +19,7 @@ tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): er module M { } M = null; // Error ~ -!!! error TS2304: Cannot find name 'M'. +!!! error TS2708: Cannot use namespace 'M' as a value here because it has no value export. class C { } C = null; // Error diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt index b0b0f876be4..889a6c3ce79 100644 --- a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt @@ -5,7 +5,7 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(11,1): error TS2322: Ty tests/cases/compiler/defaultArgsInFunctionExpressions.ts(14,51): error TS2352: Type 'string' cannot be converted to type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(17,41): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(20,62): error TS2352: Type 'string' cannot be converted to type 'number'. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: Cannot find name 'T'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2708: Cannot use namespace 'T' as a value here because it has no value export. ==== tests/cases/compiler/defaultArgsInFunctionExpressions.ts (8 errors) ==== @@ -52,7 +52,7 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: C var f6 = (t = T) => { }; ~ -!!! error TS2304: Cannot find name 'T'. +!!! error TS2708: Cannot use namespace 'T' as a value here because it has no value export. var f7 = (t = U) => { return t; }; f7().x; \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt index 7635608f58e..05d88ae9d39 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt @@ -15,7 +15,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,38): error TS2314: Generic type 'I' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(20,17): error TS2689: Cannot extend an interface 'I'. Did you mean 'implements'? tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(23,21): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(29,18): error TS2304: Cannot find name 'M'. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(29,18): error TS2708: Cannot use namespace 'M' as a value here because it has no value export. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(30,24): error TS2314: Generic type 'E' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(31,24): error TS2694: Namespace 'M' has no exported member 'C'. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(33,22): error TS2314: Generic type 'I' requires 1 type argument(s). @@ -89,7 +89,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc class D2 extends M.C { } ~ -!!! error TS2304: Cannot find name 'M'. +!!! error TS2708: Cannot use namespace 'M' as a value here because it has no value export. interface D3 { } ~~~ !!! error TS2314: Generic type 'E' requires 1 type argument(s). diff --git a/tests/baselines/reference/importDeclWithClassModifiers.errors.txt b/tests/baselines/reference/importDeclWithClassModifiers.errors.txt index e1b8867d069..8c82322d384 100644 --- a/tests/baselines/reference/importDeclWithClassModifiers.errors.txt +++ b/tests/baselines/reference/importDeclWithClassModifiers.errors.txt @@ -1,11 +1,11 @@ tests/cases/compiler/importDeclWithClassModifiers.ts(5,8): error TS1044: 'public' modifier cannot appear on a module or namespace element. -tests/cases/compiler/importDeclWithClassModifiers.ts(5,26): error TS2304: Cannot find name 'x'. +tests/cases/compiler/importDeclWithClassModifiers.ts(5,26): error TS2708: Cannot use namespace 'x' as a value here because it has no value export. tests/cases/compiler/importDeclWithClassModifiers.ts(5,28): error TS2694: Namespace 'x' has no exported member 'c'. tests/cases/compiler/importDeclWithClassModifiers.ts(6,8): error TS1044: 'private' modifier cannot appear on a module or namespace element. -tests/cases/compiler/importDeclWithClassModifiers.ts(6,27): error TS2304: Cannot find name 'x'. +tests/cases/compiler/importDeclWithClassModifiers.ts(6,27): error TS2708: Cannot use namespace 'x' as a value here because it has no value export. tests/cases/compiler/importDeclWithClassModifiers.ts(6,29): error TS2694: Namespace 'x' has no exported member 'c'. tests/cases/compiler/importDeclWithClassModifiers.ts(7,8): error TS1044: 'static' modifier cannot appear on a module or namespace element. -tests/cases/compiler/importDeclWithClassModifiers.ts(7,26): error TS2304: Cannot find name 'x'. +tests/cases/compiler/importDeclWithClassModifiers.ts(7,26): error TS2708: Cannot use namespace 'x' as a value here because it has no value export. tests/cases/compiler/importDeclWithClassModifiers.ts(7,28): error TS2694: Namespace 'x' has no exported member 'c'. @@ -18,21 +18,21 @@ tests/cases/compiler/importDeclWithClassModifiers.ts(7,28): error TS2694: Namesp ~~~~~~ !!! error TS1044: 'public' modifier cannot appear on a module or namespace element. ~ -!!! error TS2304: Cannot find name 'x'. +!!! error TS2708: Cannot use namespace 'x' as a value here because it has no value export. ~ !!! error TS2694: Namespace 'x' has no exported member 'c'. export private import b = x.c; ~~~~~~~ !!! error TS1044: 'private' modifier cannot appear on a module or namespace element. ~ -!!! error TS2304: Cannot find name 'x'. +!!! error TS2708: Cannot use namespace 'x' as a value here because it has no value export. ~ !!! error TS2694: Namespace 'x' has no exported member 'c'. export static import c = x.c; ~~~~~~ !!! error TS1044: 'static' modifier cannot appear on a module or namespace element. ~ -!!! error TS2304: Cannot find name 'x'. +!!! error TS2708: Cannot use namespace 'x' as a value here because it has no value export. ~ !!! error TS2694: Namespace 'x' has no exported member 'c'. var b: a; diff --git a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt index d69a88964cc..696926dd4a1 100644 --- a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt +++ b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/importDeclWithDeclareModifier.ts(5,9): error TS1029: 'export' modifier must precede 'declare' modifier. -tests/cases/compiler/importDeclWithDeclareModifier.ts(5,27): error TS2304: Cannot find name 'x'. +tests/cases/compiler/importDeclWithDeclareModifier.ts(5,27): error TS2708: Cannot use namespace 'x' as a value here because it has no value export. tests/cases/compiler/importDeclWithDeclareModifier.ts(5,29): error TS2694: Namespace 'x' has no exported member 'c'. @@ -12,7 +12,7 @@ tests/cases/compiler/importDeclWithDeclareModifier.ts(5,29): error TS2694: Names ~~~~~~ !!! error TS1029: 'export' modifier must precede 'declare' modifier. ~ -!!! error TS2304: Cannot find name 'x'. +!!! error TS2708: Cannot use namespace 'x' as a value here because it has no value export. ~ !!! error TS2694: Namespace 'x' has no exported member 'c'. var b: a; diff --git a/tests/baselines/reference/importDeclWithExportModifier.errors.txt b/tests/baselines/reference/importDeclWithExportModifier.errors.txt index 56e9a159afb..d211b750ca3 100644 --- a/tests/baselines/reference/importDeclWithExportModifier.errors.txt +++ b/tests/baselines/reference/importDeclWithExportModifier.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/importDeclWithExportModifier.ts(5,19): error TS2304: Cannot find name 'x'. +tests/cases/compiler/importDeclWithExportModifier.ts(5,19): error TS2708: Cannot use namespace 'x' as a value here because it has no value export. tests/cases/compiler/importDeclWithExportModifier.ts(5,21): error TS2694: Namespace 'x' has no exported member 'c'. @@ -9,7 +9,7 @@ tests/cases/compiler/importDeclWithExportModifier.ts(5,21): error TS2694: Namesp } export import a = x.c; ~ -!!! error TS2304: Cannot find name 'x'. +!!! error TS2708: Cannot use namespace 'x' as a value here because it has no value export. ~ !!! error TS2694: Namespace 'x' has no exported member 'c'. var b: a; diff --git a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt index ff3c47e9f33..fbe7fde272d 100644 --- a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt +++ b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(5,19): error TS2304: Cannot find name 'x'. +tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(5,19): error TS2708: Cannot use namespace 'x' as a value here because it has no value export. tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(5,21): error TS2694: Namespace 'x' has no exported member 'c'. tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. @@ -10,7 +10,7 @@ tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(6,1): er } export import a = x.c; ~ -!!! error TS2304: Cannot find name 'x'. +!!! error TS2708: Cannot use namespace 'x' as a value here because it has no value export. ~ !!! error TS2694: Namespace 'x' has no exported member 'c'. export = x; diff --git a/tests/baselines/reference/importStatementsInterfaces.errors.txt b/tests/baselines/reference/importStatementsInterfaces.errors.txt index 313365fb191..d591997117f 100644 --- a/tests/baselines/reference/importStatementsInterfaces.errors.txt +++ b/tests/baselines/reference/importStatementsInterfaces.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/internalModules/codeGeneration/importStatementsInterfaces.ts(23,19): error TS2304: Cannot find name 'a'. +tests/cases/conformance/internalModules/codeGeneration/importStatementsInterfaces.ts(23,19): error TS2708: Cannot use namespace 'a' as a value here because it has no value export. ==== tests/cases/conformance/internalModules/codeGeneration/importStatementsInterfaces.ts (1 errors) ==== @@ -26,7 +26,7 @@ tests/cases/conformance/internalModules/codeGeneration/importStatementsInterface import b = a.inA; var m: typeof a; ~ -!!! error TS2304: Cannot find name 'a'. +!!! error TS2708: Cannot use namespace 'a' as a value here because it has no value export. var p: b.Point3D; var p = {x:0, y:0, z: 0 }; } diff --git a/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt b/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt index 5be40b5b7b6..faa6a0096fa 100644 --- a/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt +++ b/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/interfaceNameAsIdentifier.ts(4,1): error TS2693: 'C' only refers to a type, but is being used as a value here. -tests/cases/compiler/interfaceNameAsIdentifier.ts(12,1): error TS2304: Cannot find name 'm2'. +tests/cases/compiler/interfaceNameAsIdentifier.ts(12,1): error TS2708: Cannot use namespace 'm2' as a value here because it has no value export. ==== tests/cases/compiler/interfaceNameAsIdentifier.ts (2 errors) ==== @@ -18,5 +18,5 @@ tests/cases/compiler/interfaceNameAsIdentifier.ts(12,1): error TS2304: Cannot fi m2.C(); ~~ -!!! error TS2304: Cannot find name 'm2'. +!!! error TS2708: Cannot use namespace 'm2' as a value here because it has no value export. \ No newline at end of file diff --git a/tests/baselines/reference/memberScope.errors.txt b/tests/baselines/reference/memberScope.errors.txt index 017a28d5f71..1d69c350d7c 100644 --- a/tests/baselines/reference/memberScope.errors.txt +++ b/tests/baselines/reference/memberScope.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/memberScope.ts(4,11): error TS2304: Cannot find name 'Basil'. +tests/cases/compiler/memberScope.ts(4,11): error TS2708: Cannot use namespace 'Basil' as a value here because it has no value export. ==== tests/cases/compiler/memberScope.ts (1 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/memberScope.ts(4,11): error TS2304: Cannot find name 'Basil export module Basil { } var z = Basil.Pepper; ~~~~~ -!!! error TS2304: Cannot find name 'Basil'. +!!! error TS2708: Cannot use namespace 'Basil' as a value here because it has no value export. } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAsBaseType.errors.txt b/tests/baselines/reference/moduleAsBaseType.errors.txt index ffa30ad0ab3..5313c28fbae 100644 --- a/tests/baselines/reference/moduleAsBaseType.errors.txt +++ b/tests/baselines/reference/moduleAsBaseType.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/moduleAsBaseType.ts(2,17): error TS2304: Cannot find name 'M'. -tests/cases/compiler/moduleAsBaseType.ts(3,21): error TS2304: Cannot find name 'M'. -tests/cases/compiler/moduleAsBaseType.ts(4,21): error TS2304: Cannot find name 'M'. +tests/cases/compiler/moduleAsBaseType.ts(2,17): error TS2708: Cannot use namespace 'M' as a value here because it has no value export. +tests/cases/compiler/moduleAsBaseType.ts(3,21): error TS2708: Cannot use namespace 'M' as a value here because it has no value export. +tests/cases/compiler/moduleAsBaseType.ts(4,21): error TS2708: Cannot use namespace 'M' as a value here because it has no value export. ==== tests/cases/compiler/moduleAsBaseType.ts (3 errors) ==== module M {} class C extends M {} ~ -!!! error TS2304: Cannot find name 'M'. +!!! error TS2708: Cannot use namespace 'M' as a value here because it has no value export. interface I extends M { } ~ -!!! error TS2304: Cannot find name 'M'. +!!! error TS2708: Cannot use namespace 'M' as a value here because it has no value export. class C2 implements M { } ~ -!!! error TS2304: Cannot find name 'M'. \ No newline at end of file +!!! error TS2708: Cannot use namespace 'M' as a value here because it has no value export. \ No newline at end of file diff --git a/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt b/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt index c387f5d62f4..5636b97e8cd 100644 --- a/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt +++ b/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt @@ -1,20 +1,20 @@ -tests/cases/compiler/moduleWithNoValuesAsType.ts(2,8): error TS2304: Cannot find name 'A'. -tests/cases/compiler/moduleWithNoValuesAsType.ts(7,8): error TS2304: Cannot find name 'B'. -tests/cases/compiler/moduleWithNoValuesAsType.ts(15,8): error TS2304: Cannot find name 'C'. +tests/cases/compiler/moduleWithNoValuesAsType.ts(2,8): error TS2708: Cannot use namespace 'A' as a value here because it has no value export. +tests/cases/compiler/moduleWithNoValuesAsType.ts(7,8): error TS2708: Cannot use namespace 'B' as a value here because it has no value export. +tests/cases/compiler/moduleWithNoValuesAsType.ts(15,8): error TS2708: Cannot use namespace 'C' as a value here because it has no value export. ==== tests/cases/compiler/moduleWithNoValuesAsType.ts (3 errors) ==== module A { } var a: A; // error ~ -!!! error TS2304: Cannot find name 'A'. +!!! error TS2708: Cannot use namespace 'A' as a value here because it has no value export. module B { interface I {} } var b: B; // error ~ -!!! error TS2304: Cannot find name 'B'. +!!! error TS2708: Cannot use namespace 'B' as a value here because it has no value export. module C { module M { @@ -24,4 +24,4 @@ tests/cases/compiler/moduleWithNoValuesAsType.ts(15,8): error TS2304: Cannot fin var c: C; // error ~ -!!! error TS2304: Cannot find name 'C'. \ No newline at end of file +!!! error TS2708: Cannot use namespace 'C' as a value here because it has no value export. \ No newline at end of file diff --git a/tests/baselines/reference/namespaceModule.errors.txt b/tests/baselines/reference/namespaceModule.errors.txt new file mode 100644 index 00000000000..b23f9621c58 --- /dev/null +++ b/tests/baselines/reference/namespaceModule.errors.txt @@ -0,0 +1,19 @@ +tests/cases/compiler/namespaceModule.ts(3,1): error TS2708: Cannot use namespace 'z' as a value here because it has no value export. +tests/cases/compiler/namespaceModule.ts(9,1): error TS2708: Cannot use namespace 'x' as a value here because it has no value export. + + +==== tests/cases/compiler/namespaceModule.ts (2 errors) ==== + namespace z {} + + z; + ~ +!!! error TS2708: Cannot use namespace 'z' as a value here because it has no value export. + + namespace x { + export type z = string; + } + + x; + ~ +!!! error TS2708: Cannot use namespace 'x' as a value here because it has no value export. + \ No newline at end of file diff --git a/tests/baselines/reference/namespaceModule.js b/tests/baselines/reference/namespaceModule.js new file mode 100644 index 00000000000..18bf3cf7b22 --- /dev/null +++ b/tests/baselines/reference/namespaceModule.js @@ -0,0 +1,15 @@ +//// [namespaceModule.ts] +namespace z {} + +z; + +namespace x { + export type z = string; +} + +x; + + +//// [namespaceModule.js] +z; +x; diff --git a/tests/baselines/reference/typeUsedAsValueError2.errors.txt b/tests/baselines/reference/typeUsedAsValueError2.errors.txt index 3027abb0e6b..a471055913d 100644 --- a/tests/baselines/reference/typeUsedAsValueError2.errors.txt +++ b/tests/baselines/reference/typeUsedAsValueError2.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/world.ts(4,1): error TS2693: 'HelloInterface' only refers to a type, but is being used as a value here. -tests/cases/compiler/world.ts(5,1): error TS2304: Cannot find name 'HelloNamespace'. +tests/cases/compiler/world.ts(5,1): error TS2708: Cannot use namespace 'HelloNamespace' as a value here because it has no value export. ==== tests/cases/compiler/world.ts (2 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/world.ts(5,1): error TS2304: Cannot find name 'HelloNamespa !!! error TS2693: 'HelloInterface' only refers to a type, but is being used as a value here. HelloNamespace.world; ~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'HelloNamespace'. +!!! error TS2708: Cannot use namespace 'HelloNamespace' as a value here because it has no value export. ==== tests/cases/compiler/helloInterface.ts (0 errors) ==== interface HelloInterface { world: any; diff --git a/tests/baselines/reference/typeofInternalModules.errors.txt b/tests/baselines/reference/typeofInternalModules.errors.txt index c98456c3404..b84e65fe218 100644 --- a/tests/baselines/reference/typeofInternalModules.errors.txt +++ b/tests/baselines/reference/typeofInternalModules.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/typeofInternalModules.ts(15,16): error TS2304: Cannot find name 'importUninst'. +tests/cases/compiler/typeofInternalModules.ts(15,16): error TS2708: Cannot use namespace 'importUninst' as a value here because it has no value export. tests/cases/compiler/typeofInternalModules.ts(17,9): error TS2304: Cannot find name 'Outer'. tests/cases/compiler/typeofInternalModules.ts(19,1): error TS2322: Type 'typeof Outer' is not assignable to type 'typeof instantiated'. Property 'C' is missing in type 'typeof Outer'. -tests/cases/compiler/typeofInternalModules.ts(21,16): error TS2304: Cannot find name 'importUninst'. +tests/cases/compiler/typeofInternalModules.ts(21,16): error TS2708: Cannot use namespace 'importUninst' as a value here because it has no value export. tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2322: Type 'typeof instantiated' is not assignable to type 'typeof Outer'. Property 'instantiated' is missing in type 'typeof instantiated'. @@ -24,7 +24,7 @@ tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2322: Type 'typeof var x2: importInst.C = new x1(); var x3: typeof importUninst.P; // Error again ~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'importUninst'. +!!! error TS2708: Cannot use namespace 'importUninst' as a value here because it has no value export. var x4: Outer = Outer; ~~~~~ @@ -37,7 +37,7 @@ tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2322: Type 'typeof x5 = Outer.instantiated; var x6: typeof importUninst; ~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'importUninst'. +!!! error TS2708: Cannot use namespace 'importUninst' as a value here because it has no value export. var x7: typeof Outer = Outer; x7 = importInst; ~~ diff --git a/tests/cases/compiler/namespaceModule.ts b/tests/cases/compiler/namespaceModule.ts new file mode 100644 index 00000000000..a1ad71d96a0 --- /dev/null +++ b/tests/cases/compiler/namespaceModule.ts @@ -0,0 +1,9 @@ +namespace z {} + +z; + +namespace x { + export type z = string; +} + +x;