Add tests
This commit is contained in:
parent
b52d9ec23e
commit
4ef687c5fa
|
@ -0,0 +1,42 @@
|
|||
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0.ts(3,1): error TS1201: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead.
|
||||
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_1.ts(3,27): error TS2305: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0"' has no exported member 'a'.
|
||||
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_1.ts(5,27): error TS2305: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0"' has no exported member 'a'.
|
||||
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_1.ts(7,27): error TS2305: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0"' has no exported member 'x'.
|
||||
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_1.ts(7,30): error TS2305: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0"' has no exported member 'a'.
|
||||
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_1.ts(9,27): error TS2305: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0"' has no exported member 'x'.
|
||||
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_1.ts(11,27): error TS2305: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0"' has no exported member 'm'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0.ts (1 errors) ====
|
||||
|
||||
var a = 10;
|
||||
export = a;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1201: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead.
|
||||
|
||||
==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_1.ts (6 errors) ====
|
||||
import defaultBinding1, { } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding1;
|
||||
import defaultBinding2, { a } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
~
|
||||
!!! error TS2305: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0"' has no exported member 'a'.
|
||||
var x1: number = defaultBinding2;
|
||||
import defaultBinding3, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
~
|
||||
!!! error TS2305: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0"' has no exported member 'a'.
|
||||
var x1: number = defaultBinding3;
|
||||
import defaultBinding4, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
~
|
||||
!!! error TS2305: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0"' has no exported member 'x'.
|
||||
~
|
||||
!!! error TS2305: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0"' has no exported member 'a'.
|
||||
var x1: number = defaultBinding4;
|
||||
import defaultBinding5, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
~
|
||||
!!! error TS2305: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0"' has no exported member 'x'.
|
||||
var x1: number = defaultBinding5;
|
||||
import defaultBinding6, { m, } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
~
|
||||
!!! error TS2305: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1_0"' has no exported member 'm'.
|
||||
var x1: number = defaultBinding6;
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
//// [tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1.ts] ////
|
||||
|
||||
//// [es6ImportDefaultBindingFollowedWithNamedImport1_0.ts]
|
||||
|
||||
var a = 10;
|
||||
export = a;
|
||||
|
||||
//// [es6ImportDefaultBindingFollowedWithNamedImport1_1.ts]
|
||||
import defaultBinding1, { } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding1;
|
||||
import defaultBinding2, { a } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding2;
|
||||
import defaultBinding3, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding3;
|
||||
import defaultBinding4, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding4;
|
||||
import defaultBinding5, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding5;
|
||||
import defaultBinding6, { m, } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding6;
|
||||
|
||||
|
||||
//// [es6ImportDefaultBindingFollowedWithNamedImport1_0.js]
|
||||
var a = 10;
|
||||
module.exports = a;
|
||||
//// [es6ImportDefaultBindingFollowedWithNamedImport1_1.js]
|
||||
var defaultBinding1 = require("es6ImportDefaultBindingFollowedWithNamedImport1_0");
|
||||
var x1 = defaultBinding1;
|
||||
var defaultBinding2 = require("es6ImportDefaultBindingFollowedWithNamedImport1_0");
|
||||
var x1 = defaultBinding2;
|
||||
var defaultBinding3 = require("es6ImportDefaultBindingFollowedWithNamedImport1_0");
|
||||
var x1 = defaultBinding3;
|
||||
var defaultBinding4 = require("es6ImportDefaultBindingFollowedWithNamedImport1_0");
|
||||
var x1 = defaultBinding4;
|
||||
var defaultBinding5 = require("es6ImportDefaultBindingFollowedWithNamedImport1_0");
|
||||
var x1 = defaultBinding5;
|
||||
var defaultBinding6 = require("es6ImportDefaultBindingFollowedWithNamedImport1_0");
|
||||
var x1 = defaultBinding6;
|
||||
|
||||
|
||||
//// [es6ImportDefaultBindingFollowedWithNamedImport1_0.d.ts]
|
||||
declare var a: number;
|
||||
export = a;
|
||||
//// [es6ImportDefaultBindingFollowedWithNamedImport1_1.d.ts]
|
|
@ -0,0 +1,61 @@
|
|||
tests/cases/compiler/client.ts(1,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export or export assignment.
|
||||
tests/cases/compiler/client.ts(2,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export or export assignment.
|
||||
tests/cases/compiler/client.ts(3,12): error TS4025: Exported variable 'x1' has or is using private name 'a'.
|
||||
tests/cases/compiler/client.ts(4,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export or export assignment.
|
||||
tests/cases/compiler/client.ts(5,12): error TS4025: Exported variable 'x2' has or is using private name 'b'.
|
||||
tests/cases/compiler/client.ts(6,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export or export assignment.
|
||||
tests/cases/compiler/client.ts(7,12): error TS4025: Exported variable 'x4' has or is using private name 'x'.
|
||||
tests/cases/compiler/client.ts(8,12): error TS4025: Exported variable 'x5' has or is using private name 'y'.
|
||||
tests/cases/compiler/client.ts(9,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export or export assignment.
|
||||
tests/cases/compiler/client.ts(10,12): error TS4025: Exported variable 'x3' has or is using private name 'z'.
|
||||
tests/cases/compiler/client.ts(11,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export or export assignment.
|
||||
tests/cases/compiler/client.ts(12,12): error TS4025: Exported variable 'x6' has or is using private name 'm'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/server.ts (0 errors) ====
|
||||
|
||||
export class a { }
|
||||
export class x { }
|
||||
export class m { }
|
||||
export class a11 { }
|
||||
export class a12 { }
|
||||
export class x11 { }
|
||||
|
||||
==== tests/cases/compiler/client.ts (12 errors) ====
|
||||
import defaultBinding1, { } from "server";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export or export assignment.
|
||||
import defaultBinding2, { a } from "server";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export or export assignment.
|
||||
export var x1 = new a();
|
||||
~~
|
||||
!!! error TS4025: Exported variable 'x1' has or is using private name 'a'.
|
||||
import defaultBinding3, { a11 as b } from "server";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export or export assignment.
|
||||
export var x2 = new b();
|
||||
~~
|
||||
!!! error TS4025: Exported variable 'x2' has or is using private name 'b'.
|
||||
import defaultBinding4, { x, a12 as y } from "server";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export or export assignment.
|
||||
export var x4 = new x();
|
||||
~~
|
||||
!!! error TS4025: Exported variable 'x4' has or is using private name 'x'.
|
||||
export var x5 = new y();
|
||||
~~
|
||||
!!! error TS4025: Exported variable 'x5' has or is using private name 'y'.
|
||||
import defaultBinding5, { x11 as z, } from "server";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export or export assignment.
|
||||
export var x3 = new z();
|
||||
~~
|
||||
!!! error TS4025: Exported variable 'x3' has or is using private name 'z'.
|
||||
import defaultBinding6, { m, } from "server";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export or export assignment.
|
||||
export var x6 = new m();
|
||||
~~
|
||||
!!! error TS4025: Exported variable 'x6' has or is using private name 'm'.
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
//// [tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportDts.ts] ////
|
||||
|
||||
//// [server.ts]
|
||||
|
||||
export class a { }
|
||||
export class x { }
|
||||
export class m { }
|
||||
export class a11 { }
|
||||
export class a12 { }
|
||||
export class x11 { }
|
||||
|
||||
//// [client.ts]
|
||||
import defaultBinding1, { } from "server";
|
||||
import defaultBinding2, { a } from "server";
|
||||
export var x1 = new a();
|
||||
import defaultBinding3, { a11 as b } from "server";
|
||||
export var x2 = new b();
|
||||
import defaultBinding4, { x, a12 as y } from "server";
|
||||
export var x4 = new x();
|
||||
export var x5 = new y();
|
||||
import defaultBinding5, { x11 as z, } from "server";
|
||||
export var x3 = new z();
|
||||
import defaultBinding6, { m, } from "server";
|
||||
export var x6 = new m();
|
||||
|
||||
|
||||
//// [server.js]
|
||||
var a = (function () {
|
||||
function a() {
|
||||
}
|
||||
return a;
|
||||
})();
|
||||
exports.a = a;
|
||||
var x = (function () {
|
||||
function x() {
|
||||
}
|
||||
return x;
|
||||
})();
|
||||
exports.x = x;
|
||||
var m = (function () {
|
||||
function m() {
|
||||
}
|
||||
return m;
|
||||
})();
|
||||
exports.m = m;
|
||||
var a11 = (function () {
|
||||
function a11() {
|
||||
}
|
||||
return a11;
|
||||
})();
|
||||
exports.a11 = a11;
|
||||
var a12 = (function () {
|
||||
function a12() {
|
||||
}
|
||||
return a12;
|
||||
})();
|
||||
exports.a12 = a12;
|
||||
var x11 = (function () {
|
||||
function x11() {
|
||||
}
|
||||
return x11;
|
||||
})();
|
||||
exports.x11 = x11;
|
||||
//// [client.js]
|
||||
var defaultBinding2 = require("server");
|
||||
exports.x1 = new _server_1.a();
|
||||
var defaultBinding3 = require("server");
|
||||
exports.x2 = new _server_2.a11();
|
||||
var defaultBinding4 = require("server");
|
||||
exports.x4 = new _server_3.x();
|
||||
exports.x5 = new _server_3.a12();
|
||||
var defaultBinding5 = require("server");
|
||||
exports.x3 = new _server_4.x11();
|
||||
var defaultBinding6 = require("server");
|
||||
exports.x6 = new _server_5.m();
|
||||
|
||||
|
||||
//// [server.d.ts]
|
||||
export declare class a {
|
||||
}
|
||||
export declare class x {
|
||||
}
|
||||
export declare class m {
|
||||
}
|
||||
export declare class a11 {
|
||||
}
|
||||
export declare class a12 {
|
||||
}
|
||||
export declare class x11 {
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts(3,1): error TS1201: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts (1 errors) ====
|
||||
|
||||
var a = 10;
|
||||
export = a;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1201: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead.
|
||||
|
||||
==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts (0 errors) ====
|
||||
import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBinding_0";
|
||||
var x: number = defaultBinding;
|
|
@ -0,0 +1,23 @@
|
|||
//// [tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding1.ts] ////
|
||||
|
||||
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts]
|
||||
|
||||
var a = 10;
|
||||
export = a;
|
||||
|
||||
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts]
|
||||
import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBinding_0";
|
||||
var x: number = defaultBinding;
|
||||
|
||||
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_0.js]
|
||||
var a = 10;
|
||||
module.exports = a;
|
||||
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_1.js]
|
||||
var defaultBinding = require("es6ImportDefaultBindingFollowedWithNamespaceBinding_0");
|
||||
var x = defaultBinding;
|
||||
|
||||
|
||||
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_0.d.ts]
|
||||
declare var a: number;
|
||||
export = a;
|
||||
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_1.d.ts]
|
|
@ -0,0 +1,26 @@
|
|||
tests/cases/compiler/es6ImportDefaultBindingMergeErrors_1.ts(5,8): error TS2440: Import declaration conflicts with local declaration of 'defaultBinding2'
|
||||
tests/cases/compiler/es6ImportDefaultBindingMergeErrors_1.ts(7,8): error TS2300: Duplicate identifier 'defaultBinding3'.
|
||||
tests/cases/compiler/es6ImportDefaultBindingMergeErrors_1.ts(8,8): error TS2300: Duplicate identifier 'defaultBinding3'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6ImportDefaultBindingMergeErrors_0.ts (0 errors) ====
|
||||
|
||||
var a = 10;
|
||||
export = a;
|
||||
|
||||
==== tests/cases/compiler/es6ImportDefaultBindingMergeErrors_1.ts (3 errors) ====
|
||||
import defaultBinding from "es6ImportDefaultBindingMergeErrors_0";
|
||||
interface defaultBinding { // This is ok
|
||||
}
|
||||
var x = defaultBinding;
|
||||
import defaultBinding2 from "es6ImportDefaultBindingMergeErrors_0"; // Should be error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2440: Import declaration conflicts with local declaration of 'defaultBinding2'
|
||||
var defaultBinding2 = "hello world";
|
||||
import defaultBinding3 from "es6ImportDefaultBindingMergeErrors_0"; // Should be error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'defaultBinding3'.
|
||||
import defaultBinding3 from "es6ImportDefaultBindingMergeErrors_0"; // SHould be error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'defaultBinding3'.
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
//// [tests/cases/compiler/es6ImportDefaultBindingMergeErrors.ts] ////
|
||||
|
||||
//// [es6ImportDefaultBindingMergeErrors_0.ts]
|
||||
|
||||
var a = 10;
|
||||
export = a;
|
||||
|
||||
//// [es6ImportDefaultBindingMergeErrors_1.ts]
|
||||
import defaultBinding from "es6ImportDefaultBindingMergeErrors_0";
|
||||
interface defaultBinding { // This is ok
|
||||
}
|
||||
var x = defaultBinding;
|
||||
import defaultBinding2 from "es6ImportDefaultBindingMergeErrors_0"; // Should be error
|
||||
var defaultBinding2 = "hello world";
|
||||
import defaultBinding3 from "es6ImportDefaultBindingMergeErrors_0"; // Should be error
|
||||
import defaultBinding3 from "es6ImportDefaultBindingMergeErrors_0"; // SHould be error
|
||||
|
||||
|
||||
//// [es6ImportDefaultBindingMergeErrors_0.js]
|
||||
var a = 10;
|
||||
module.exports = a;
|
||||
//// [es6ImportDefaultBindingMergeErrors_1.js]
|
||||
var defaultBinding = require("es6ImportDefaultBindingMergeErrors_0");
|
||||
var x = defaultBinding;
|
||||
var defaultBinding2 = "hello world";
|
|
@ -0,0 +1,12 @@
|
|||
tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_1.ts(1,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_0"' has no default export or export assignment.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_0.ts (0 errors) ====
|
||||
|
||||
export var a = 10;
|
||||
|
||||
==== tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_1.ts (1 errors) ====
|
||||
import defaultBinding from "es6ImportDefaultBindingNoDefaultProperty_0";
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_0"' has no default export or export assignment.
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
//// [tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty.ts] ////
|
||||
|
||||
//// [es6ImportDefaultBindingNoDefaultProperty_0.ts]
|
||||
|
||||
export var a = 10;
|
||||
|
||||
//// [es6ImportDefaultBindingNoDefaultProperty_1.ts]
|
||||
import defaultBinding from "es6ImportDefaultBindingNoDefaultProperty_0";
|
||||
|
||||
|
||||
//// [es6ImportDefaultBindingNoDefaultProperty_0.js]
|
||||
exports.a = 10;
|
||||
//// [es6ImportDefaultBindingNoDefaultProperty_1.js]
|
|
@ -0,0 +1,33 @@
|
|||
tests/cases/compiler/es6ImportNamedImportMergeErrors_1.ts(5,10): error TS2440: Import declaration conflicts with local declaration of 'x'
|
||||
tests/cases/compiler/es6ImportNamedImportMergeErrors_1.ts(7,10): error TS2440: Import declaration conflicts with local declaration of 'x44'
|
||||
tests/cases/compiler/es6ImportNamedImportMergeErrors_1.ts(9,10): error TS2300: Duplicate identifier 'z'.
|
||||
tests/cases/compiler/es6ImportNamedImportMergeErrors_1.ts(10,16): error TS2300: Duplicate identifier 'z'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6ImportNamedImportMergeErrors_0.ts (0 errors) ====
|
||||
|
||||
export var a = 10;
|
||||
export var x = a;
|
||||
export var z = a;
|
||||
export var z1 = a;
|
||||
|
||||
==== tests/cases/compiler/es6ImportNamedImportMergeErrors_1.ts (4 errors) ====
|
||||
import { a } from "es6ImportNamedImportMergeErrors_0";
|
||||
interface a { } // shouldnt be error
|
||||
import { x as x1 } from "es6ImportNamedImportMergeErrors_0";
|
||||
interface x1 { } // shouldnt be error
|
||||
import { x } from "es6ImportNamedImportMergeErrors_0"; // should be error
|
||||
~
|
||||
!!! error TS2440: Import declaration conflicts with local declaration of 'x'
|
||||
var x = 10;
|
||||
import { x as x44 } from "es6ImportNamedImportMergeErrors_0"; // should be error
|
||||
~~~~~~~~
|
||||
!!! error TS2440: Import declaration conflicts with local declaration of 'x44'
|
||||
var x44 = 10;
|
||||
import { z } from "es6ImportNamedImportMergeErrors_0"; // should be error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'z'.
|
||||
import { z1 as z } from "es6ImportNamedImportMergeErrors_0"; // should be error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'z'.
|
||||
|
30
tests/baselines/reference/es6ImportNamedImportMergeErrors.js
Normal file
30
tests/baselines/reference/es6ImportNamedImportMergeErrors.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
//// [tests/cases/compiler/es6ImportNamedImportMergeErrors.ts] ////
|
||||
|
||||
//// [es6ImportNamedImportMergeErrors_0.ts]
|
||||
|
||||
export var a = 10;
|
||||
export var x = a;
|
||||
export var z = a;
|
||||
export var z1 = a;
|
||||
|
||||
//// [es6ImportNamedImportMergeErrors_1.ts]
|
||||
import { a } from "es6ImportNamedImportMergeErrors_0";
|
||||
interface a { } // shouldnt be error
|
||||
import { x as x1 } from "es6ImportNamedImportMergeErrors_0";
|
||||
interface x1 { } // shouldnt be error
|
||||
import { x } from "es6ImportNamedImportMergeErrors_0"; // should be error
|
||||
var x = 10;
|
||||
import { x as x44 } from "es6ImportNamedImportMergeErrors_0"; // should be error
|
||||
var x44 = 10;
|
||||
import { z } from "es6ImportNamedImportMergeErrors_0"; // should be error
|
||||
import { z1 as z } from "es6ImportNamedImportMergeErrors_0"; // should be error
|
||||
|
||||
|
||||
//// [es6ImportNamedImportMergeErrors_0.js]
|
||||
exports.a = 10;
|
||||
exports.x = exports.a;
|
||||
exports.z = exports.a;
|
||||
exports.z1 = exports.a;
|
||||
//// [es6ImportNamedImportMergeErrors_1.js]
|
||||
var x = 10;
|
||||
var x44 = 10;
|
|
@ -0,0 +1,16 @@
|
|||
tests/cases/compiler/es6ImportNamedImport_1.ts(1,10): error TS2305: Module '"tests/cases/compiler/es6ImportNamedImportNoExportMember_0"' has no exported member 'a1'.
|
||||
tests/cases/compiler/es6ImportNamedImport_1.ts(2,10): error TS2305: Module '"tests/cases/compiler/es6ImportNamedImportNoExportMember_0"' has no exported member 'x1'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6ImportNamedImportNoExportMember_0.ts (0 errors) ====
|
||||
|
||||
export var a = 10;
|
||||
export var x = a;
|
||||
|
||||
==== tests/cases/compiler/es6ImportNamedImport_1.ts (2 errors) ====
|
||||
import { a1 } from "es6ImportNamedImportNoExportMember_0";
|
||||
~~
|
||||
!!! error TS2305: Module '"tests/cases/compiler/es6ImportNamedImportNoExportMember_0"' has no exported member 'a1'.
|
||||
import { x1 as x } from "es6ImportNamedImportNoExportMember_0";
|
||||
~~
|
||||
!!! error TS2305: Module '"tests/cases/compiler/es6ImportNamedImportNoExportMember_0"' has no exported member 'x1'.
|
|
@ -0,0 +1,15 @@
|
|||
//// [tests/cases/compiler/es6ImportNamedImportNoExportMember.ts] ////
|
||||
|
||||
//// [es6ImportNamedImportNoExportMember_0.ts]
|
||||
|
||||
export var a = 10;
|
||||
export var x = a;
|
||||
|
||||
//// [es6ImportNamedImport_1.ts]
|
||||
import { a1 } from "es6ImportNamedImportNoExportMember_0";
|
||||
import { x1 as x } from "es6ImportNamedImportNoExportMember_0";
|
||||
|
||||
//// [es6ImportNamedImportNoExportMember_0.js]
|
||||
exports.a = 10;
|
||||
exports.x = exports.a;
|
||||
//// [es6ImportNamedImport_1.js]
|
|
@ -0,0 +1,19 @@
|
|||
//// [tests/cases/compiler/es6ImportWithoutFromClauseNonInstantiatedModule.ts] ////
|
||||
|
||||
//// [es6ImportWithoutFromClauseNonInstantiatedModule_0.ts]
|
||||
|
||||
export interface i {
|
||||
}
|
||||
|
||||
//// [es6ImportWithoutFromClauseNonInstantiatedModule_1.ts]
|
||||
import "es6ImportWithoutFromClauseNonInstantiatedModule_0";
|
||||
|
||||
//// [es6ImportWithoutFromClauseNonInstantiatedModule_0.js]
|
||||
//// [es6ImportWithoutFromClauseNonInstantiatedModule_1.js]
|
||||
require("es6ImportWithoutFromClauseNonInstantiatedModule_0");
|
||||
|
||||
|
||||
//// [es6ImportWithoutFromClauseNonInstantiatedModule_0.d.ts]
|
||||
export interface i {
|
||||
}
|
||||
//// [es6ImportWithoutFromClauseNonInstantiatedModule_1.d.ts]
|
|
@ -0,0 +1,9 @@
|
|||
=== tests/cases/compiler/es6ImportWithoutFromClauseNonInstantiatedModule_0.ts ===
|
||||
|
||||
export interface i {
|
||||
>i : i
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/es6ImportWithoutFromClauseNonInstantiatedModule_1.ts ===
|
||||
import "es6ImportWithoutFromClauseNonInstantiatedModule_0";
|
||||
No type information for this code.
|
|
@ -0,0 +1,20 @@
|
|||
// @target: es6
|
||||
// @declaration: true
|
||||
|
||||
// @filename: es6ImportDefaultBindingFollowedWithNamedImport1_0.ts
|
||||
var a = 10;
|
||||
export = a;
|
||||
|
||||
// @filename: es6ImportDefaultBindingFollowedWithNamedImport1_1.ts
|
||||
import defaultBinding1, { } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding1;
|
||||
import defaultBinding2, { a } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding2;
|
||||
import defaultBinding3, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding3;
|
||||
import defaultBinding4, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding4;
|
||||
import defaultBinding5, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding5;
|
||||
import defaultBinding6, { m, } from "es6ImportDefaultBindingFollowedWithNamedImport1_0";
|
||||
var x1: number = defaultBinding6;
|
|
@ -0,0 +1,24 @@
|
|||
// @module: commonjs
|
||||
// @declaration: true
|
||||
|
||||
// @filename: server.ts
|
||||
export class a { }
|
||||
export class x { }
|
||||
export class m { }
|
||||
export class a11 { }
|
||||
export class a12 { }
|
||||
export class x11 { }
|
||||
|
||||
// @filename: client.ts
|
||||
import defaultBinding1, { } from "server";
|
||||
import defaultBinding2, { a } from "server";
|
||||
export var x1 = new a();
|
||||
import defaultBinding3, { a11 as b } from "server";
|
||||
export var x2 = new b();
|
||||
import defaultBinding4, { x, a12 as y } from "server";
|
||||
export var x4 = new x();
|
||||
export var x5 = new y();
|
||||
import defaultBinding5, { x11 as z, } from "server";
|
||||
export var x3 = new z();
|
||||
import defaultBinding6, { m, } from "server";
|
||||
export var x6 = new m();
|
|
@ -0,0 +1,10 @@
|
|||
// @target: es6
|
||||
// @declaration: true
|
||||
|
||||
// @filename: es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts
|
||||
var a = 10;
|
||||
export = a;
|
||||
|
||||
// @filename: es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts
|
||||
import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBinding_0";
|
||||
var x: number = defaultBinding;
|
15
tests/cases/compiler/es6ImportDefaultBindingMergeErrors.ts
Normal file
15
tests/cases/compiler/es6ImportDefaultBindingMergeErrors.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
// @module: commonjs
|
||||
|
||||
// @filename: es6ImportDefaultBindingMergeErrors_0.ts
|
||||
var a = 10;
|
||||
export = a;
|
||||
|
||||
// @filename: es6ImportDefaultBindingMergeErrors_1.ts
|
||||
import defaultBinding from "es6ImportDefaultBindingMergeErrors_0";
|
||||
interface defaultBinding { // This is ok
|
||||
}
|
||||
var x = defaultBinding;
|
||||
import defaultBinding2 from "es6ImportDefaultBindingMergeErrors_0"; // Should be error
|
||||
var defaultBinding2 = "hello world";
|
||||
import defaultBinding3 from "es6ImportDefaultBindingMergeErrors_0"; // Should be error
|
||||
import defaultBinding3 from "es6ImportDefaultBindingMergeErrors_0"; // SHould be error
|
|
@ -0,0 +1,7 @@
|
|||
// @module: commonjs
|
||||
|
||||
// @filename: es6ImportDefaultBindingNoDefaultProperty_0.ts
|
||||
export var a = 10;
|
||||
|
||||
// @filename: es6ImportDefaultBindingNoDefaultProperty_1.ts
|
||||
import defaultBinding from "es6ImportDefaultBindingNoDefaultProperty_0";
|
19
tests/cases/compiler/es6ImportNamedImportMergeErrors.ts
Normal file
19
tests/cases/compiler/es6ImportNamedImportMergeErrors.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
// @module: commonjs
|
||||
|
||||
// @filename: es6ImportNamedImportMergeErrors_0.ts
|
||||
export var a = 10;
|
||||
export var x = a;
|
||||
export var z = a;
|
||||
export var z1 = a;
|
||||
|
||||
// @filename: es6ImportNamedImportMergeErrors_1.ts
|
||||
import { a } from "es6ImportNamedImportMergeErrors_0";
|
||||
interface a { } // shouldnt be error
|
||||
import { x as x1 } from "es6ImportNamedImportMergeErrors_0";
|
||||
interface x1 { } // shouldnt be error
|
||||
import { x } from "es6ImportNamedImportMergeErrors_0"; // should be error
|
||||
var x = 10;
|
||||
import { x as x44 } from "es6ImportNamedImportMergeErrors_0"; // should be error
|
||||
var x44 = 10;
|
||||
import { z } from "es6ImportNamedImportMergeErrors_0"; // should be error
|
||||
import { z1 as z } from "es6ImportNamedImportMergeErrors_0"; // should be error
|
|
@ -0,0 +1,9 @@
|
|||
// @module: commonjs
|
||||
|
||||
// @filename: es6ImportNamedImportNoExportMember_0.ts
|
||||
export var a = 10;
|
||||
export var x = a;
|
||||
|
||||
// @filename: es6ImportNamedImport_1.ts
|
||||
import { a1 } from "es6ImportNamedImportNoExportMember_0";
|
||||
import { x1 as x } from "es6ImportNamedImportNoExportMember_0";
|
|
@ -0,0 +1,9 @@
|
|||
// @target: es6
|
||||
// @declaration: true
|
||||
|
||||
// @filename: es6ImportWithoutFromClauseNonInstantiatedModule_0.ts
|
||||
export interface i {
|
||||
}
|
||||
|
||||
// @filename: es6ImportWithoutFromClauseNonInstantiatedModule_1.ts
|
||||
import "es6ImportWithoutFromClauseNonInstantiatedModule_0";
|
Loading…
Reference in a new issue