diff --git a/tests/baselines/reference/classExtendingPrimitive2.errors.txt b/tests/baselines/reference/classExtendingPrimitive2.errors.txt new file mode 100644 index 0000000000000..9d1f62d535034 --- /dev/null +++ b/tests/baselines/reference/classExtendingPrimitive2.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (3 errors) ==== + // classes cannot extend primitives + + class C4a extends void {} + ~~~~ +!!! Identifier expected. + class C5a extends null { } + ~~~~ +!!! Identifier expected. + ~ +!!! ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt new file mode 100644 index 0000000000000..7a5573ae00054 --- /dev/null +++ b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (3 errors) ==== + class C2 extends { foo: string; } { } // error + ~ +!!! Identifier expected. + + class C6 extends []{ } // error + ~ +!!! Identifier expected. + ~ +!!! ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVarAndImport.js b/tests/baselines/reference/duplicateVarAndImport.js new file mode 100644 index 0000000000000..245ed733a447d --- /dev/null +++ b/tests/baselines/reference/duplicateVarAndImport.js @@ -0,0 +1,9 @@ +//// [duplicateVarAndImport.ts] +// no error since module is not instantiated + +var a; +module M { } +import a = M; + +//// [duplicateVarAndImport.js] +var a; diff --git a/tests/baselines/reference/duplicateVarAndImport2.errors.txt b/tests/baselines/reference/duplicateVarAndImport2.errors.txt new file mode 100644 index 0000000000000..b6f52fc23cbe3 --- /dev/null +++ b/tests/baselines/reference/duplicateVarAndImport2.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/duplicateVarAndImport2.ts (1 errors) ==== + // error since module is instantiated + var a; + module M { export var x = 1; } + import a = M; + ~~~~~~~~~~~~~ +!!! Import declaration conflicts with local declaration of 'a' \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVarAndImport2.js b/tests/baselines/reference/duplicateVarAndImport2.js new file mode 100644 index 0000000000000..b0c05f254a6a5 --- /dev/null +++ b/tests/baselines/reference/duplicateVarAndImport2.js @@ -0,0 +1,13 @@ +//// [duplicateVarAndImport2.ts] +// error since module is instantiated +var a; +module M { export var x = 1; } +import a = M; + +//// [duplicateVarAndImport2.js] +var a; +var M; +(function (M) { + M.x = 1; +})(M || (M = {})); +var a = M; diff --git a/tests/cases/compiler/duplicateVarAndImport.ts b/tests/cases/compiler/duplicateVarAndImport.ts new file mode 100644 index 0000000000000..f8daf5ea9c916 --- /dev/null +++ b/tests/cases/compiler/duplicateVarAndImport.ts @@ -0,0 +1,5 @@ +// no error since module is not instantiated + +var a; +module M { } +import a = M; \ No newline at end of file diff --git a/tests/cases/compiler/duplicateVarAndImport2.ts b/tests/cases/compiler/duplicateVarAndImport2.ts new file mode 100644 index 0000000000000..f42b2bcf50bdd --- /dev/null +++ b/tests/cases/compiler/duplicateVarAndImport2.ts @@ -0,0 +1,4 @@ +// error since module is instantiated +var a; +module M { export var x = 1; } +import a = M; \ No newline at end of file diff --git a/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts b/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts new file mode 100644 index 0000000000000..58b397cbd84ed --- /dev/null +++ b/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts @@ -0,0 +1,4 @@ +// classes cannot extend primitives + +class C4a extends void {} +class C5a extends null { } \ No newline at end of file diff --git a/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts b/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts new file mode 100644 index 0000000000000..095c0a1154475 --- /dev/null +++ b/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts @@ -0,0 +1,3 @@ +class C2 extends { foo: string; } { } // error + +class C6 extends []{ } // error \ No newline at end of file