mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
merged with master
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [index: string]: any; }' is not assignable to type '{ one: number; }'.
|
||||
Property 'one' is missing in type '{ [index: string]: any; }'.
|
||||
tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [index: string]: any; }'.
|
||||
Index signature is missing in type '{ one: number; }'.
|
||||
tests/cases/compiler/assignmentCompat1.ts(6,1): error TS2322: Type '{ [index: number]: any; }' is not assignable to type '{ one: number; }'.
|
||||
Property 'one' is missing in type '{ [index: number]: any; }'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompat1.ts (2 errors) ====
|
||||
var x = {one: 1};
|
||||
var y: {[index:string]: any};
|
||||
|
||||
x = y;
|
||||
var x = { one: 1 };
|
||||
var y: { [index: string]: any };
|
||||
var z: { [index: number]: any };
|
||||
x = y; // Error
|
||||
~
|
||||
!!! error TS2322: Type '{ [index: string]: any; }' is not assignable to type '{ one: number; }'.
|
||||
!!! error TS2322: Property 'one' is missing in type '{ [index: string]: any; }'.
|
||||
y = x;
|
||||
y = x; // Ok because index signature type is any
|
||||
x = z; // Error
|
||||
~
|
||||
!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [index: string]: any; }'.
|
||||
!!! error TS2322: Index signature is missing in type '{ one: number; }'.
|
||||
!!! error TS2322: Type '{ [index: number]: any; }' is not assignable to type '{ one: number; }'.
|
||||
!!! error TS2322: Property 'one' is missing in type '{ [index: number]: any; }'.
|
||||
z = x; // Ok because index signature type is any
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
//// [assignmentCompat1.ts]
|
||||
var x = {one: 1};
|
||||
var y: {[index:string]: any};
|
||||
|
||||
x = y;
|
||||
y = x;
|
||||
var x = { one: 1 };
|
||||
var y: { [index: string]: any };
|
||||
var z: { [index: number]: any };
|
||||
x = y; // Error
|
||||
y = x; // Ok because index signature type is any
|
||||
x = z; // Error
|
||||
z = x; // Ok because index signature type is any
|
||||
|
||||
|
||||
//// [assignmentCompat1.js]
|
||||
var x = { one: 1 };
|
||||
var y;
|
||||
x = y;
|
||||
y = x;
|
||||
var z;
|
||||
x = y; // Error
|
||||
y = x; // Ok because index signature type is any
|
||||
x = z; // Error
|
||||
z = x; // Ok because index signature type is any
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [index: string]: any; }'.
|
||||
Index signature is missing in type 'interfaceWithPublicAndOptional<number, string>'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompatability36.ts (1 errors) ====
|
||||
module __test1__ {
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
export var aa:{[index:string]:any;};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [index: string]: any; }'.
|
||||
!!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional<number, string>'.
|
||||
@@ -0,0 +1,39 @@
|
||||
=== tests/cases/compiler/assignmentCompatability36.ts ===
|
||||
module __test1__ {
|
||||
>__test1__ : Symbol(__test1__, Decl(assignmentCompatability36.ts, 0, 0))
|
||||
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability36.ts, 0, 18))
|
||||
>T : Symbol(T, Decl(assignmentCompatability36.ts, 1, 52))
|
||||
>U : Symbol(U, Decl(assignmentCompatability36.ts, 1, 54))
|
||||
>one : Symbol(one, Decl(assignmentCompatability36.ts, 1, 58))
|
||||
>T : Symbol(T, Decl(assignmentCompatability36.ts, 1, 52))
|
||||
>two : Symbol(two, Decl(assignmentCompatability36.ts, 1, 66))
|
||||
>U : Symbol(U, Decl(assignmentCompatability36.ts, 1, 54))
|
||||
>obj4 : Symbol(obj4, Decl(assignmentCompatability36.ts, 1, 83))
|
||||
>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability36.ts, 0, 18))
|
||||
>one : Symbol(one, Decl(assignmentCompatability36.ts, 1, 139))
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability36.ts, 2, 14))
|
||||
>obj4 : Symbol(obj4, Decl(assignmentCompatability36.ts, 1, 83))
|
||||
}
|
||||
module __test2__ {
|
||||
>__test2__ : Symbol(__test2__, Decl(assignmentCompatability36.ts, 3, 1))
|
||||
|
||||
export var aa:{[index:string]:any;};;
|
||||
>aa : Symbol(aa, Decl(assignmentCompatability36.ts, 5, 14))
|
||||
>index : Symbol(index, Decl(assignmentCompatability36.ts, 5, 20))
|
||||
|
||||
export var __val__aa = aa;
|
||||
>__val__aa : Symbol(__val__aa, Decl(assignmentCompatability36.ts, 6, 14))
|
||||
>aa : Symbol(aa, Decl(assignmentCompatability36.ts, 5, 14))
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
>__test2__.__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability36.ts, 6, 14))
|
||||
>__test2__ : Symbol(__test2__, Decl(assignmentCompatability36.ts, 3, 1))
|
||||
>__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability36.ts, 6, 14))
|
||||
>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability36.ts, 2, 14))
|
||||
>__test1__ : Symbol(__test1__, Decl(assignmentCompatability36.ts, 0, 0))
|
||||
>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability36.ts, 2, 14))
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
=== tests/cases/compiler/assignmentCompatability36.ts ===
|
||||
module __test1__ {
|
||||
>__test1__ : typeof __test1__
|
||||
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>T : T
|
||||
>U : U
|
||||
>one : T
|
||||
>T : T
|
||||
>two : U
|
||||
>U : U
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>{ one: 1 } : { one: number; }
|
||||
>one : number
|
||||
>1 : number
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
>__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
}
|
||||
module __test2__ {
|
||||
>__test2__ : typeof __test2__
|
||||
|
||||
export var aa:{[index:string]:any;};;
|
||||
>aa : { [index: string]: any; }
|
||||
>index : string
|
||||
|
||||
export var __val__aa = aa;
|
||||
>__val__aa : { [index: string]: any; }
|
||||
>aa : { [index: string]: any; }
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
>__test2__.__val__aa = __test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__aa : { [index: string]: any; }
|
||||
>__test2__ : typeof __test2__
|
||||
>__val__aa : { [index: string]: any; }
|
||||
>__test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__ : typeof __test1__
|
||||
>__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
tests/cases/compiler/classExtendsNull.ts(2,5): error TS17005: A constructor cannot contain a 'super' call when its class extends 'null'
|
||||
|
||||
|
||||
==== tests/cases/compiler/classExtendsNull.ts (1 errors) ====
|
||||
class C extends null {
|
||||
constructor() {
|
||||
~~~~~~~~~~~~~~~
|
||||
super();
|
||||
~~~~~~~~~~~~~~~~
|
||||
return Object.create(null);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
}
|
||||
~~~~~
|
||||
!!! error TS17005: A constructor cannot contain a 'super' call when its class extends 'null'
|
||||
}
|
||||
|
||||
class D extends null {
|
||||
constructor() {
|
||||
return Object.create(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//// [classExtendsNull.ts]
|
||||
class C extends null {
|
||||
constructor() {
|
||||
super();
|
||||
return Object.create(null);
|
||||
}
|
||||
}
|
||||
|
||||
class D extends null {
|
||||
constructor() {
|
||||
return Object.create(null);
|
||||
}
|
||||
}
|
||||
|
||||
//// [classExtendsNull.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var C = (function (_super) {
|
||||
__extends(C, _super);
|
||||
function C() {
|
||||
_super.call(this);
|
||||
return Object.create(null);
|
||||
}
|
||||
return C;
|
||||
})(null);
|
||||
var D = (function (_super) {
|
||||
__extends(D, _super);
|
||||
function D() {
|
||||
return Object.create(null);
|
||||
}
|
||||
return D;
|
||||
})(null);
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/constEnumErrors.ts(1,12): error TS2300: Duplicate identifier 'E'.
|
||||
tests/cases/compiler/constEnumErrors.ts(5,8): error TS2300: Duplicate identifier 'E'.
|
||||
tests/cases/compiler/constEnumErrors.ts(12,9): error TS2474: In 'const' enum declarations member initializer must be constant expression.
|
||||
tests/cases/compiler/constEnumErrors.ts(12,9): error TS2651: A member initializer in a 'const' enum declaration cannot reference members declared after it, including members defined in other 'const' enums.
|
||||
tests/cases/compiler/constEnumErrors.ts(14,9): error TS2474: In 'const' enum declarations member initializer must be constant expression.
|
||||
tests/cases/compiler/constEnumErrors.ts(15,10): error TS2474: In 'const' enum declarations member initializer must be constant expression.
|
||||
tests/cases/compiler/constEnumErrors.ts(22,13): error TS2476: A const enum member can only be accessed using a string literal.
|
||||
@@ -31,7 +31,7 @@ tests/cases/compiler/constEnumErrors.ts(42,9): error TS2478: 'const' enum member
|
||||
// forward reference to the element of the same enum
|
||||
X = Y,
|
||||
~
|
||||
!!! error TS2474: In 'const' enum declarations member initializer must be constant expression.
|
||||
!!! error TS2651: A member initializer in a 'const' enum declaration cannot reference members declared after it, including members defined in other 'const' enums.
|
||||
// forward reference to the element of the same enum
|
||||
Y = E1.Z,
|
||||
~~~~
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
//// [decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts]
|
||||
|
||||
declare var decorator: any;
|
||||
|
||||
class MyClass {
|
||||
constructor(test: string, test2: number) {
|
||||
|
||||
}
|
||||
|
||||
@decorator
|
||||
doSomething() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [decoratorMetadataForMethodWithNoReturnTypeAnnotation01.js]
|
||||
var MyClass = (function () {
|
||||
function MyClass(test, test2) {
|
||||
}
|
||||
MyClass.prototype.doSomething = function () {
|
||||
};
|
||||
Object.defineProperty(MyClass.prototype, "doSomething",
|
||||
__decorate([
|
||||
decorator,
|
||||
__metadata('design:type', Function),
|
||||
__metadata('design:paramtypes', []),
|
||||
__metadata('design:returntype', void 0)
|
||||
], MyClass.prototype, "doSomething", Object.getOwnPropertyDescriptor(MyClass.prototype, "doSomething")));
|
||||
return MyClass;
|
||||
})();
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts ===
|
||||
|
||||
declare var decorator: any;
|
||||
>decorator : Symbol(decorator, Decl(decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts, 1, 11))
|
||||
|
||||
class MyClass {
|
||||
>MyClass : Symbol(MyClass, Decl(decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts, 1, 27))
|
||||
|
||||
constructor(test: string, test2: number) {
|
||||
>test : Symbol(test, Decl(decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts, 4, 16))
|
||||
>test2 : Symbol(test2, Decl(decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts, 4, 29))
|
||||
|
||||
}
|
||||
|
||||
@decorator
|
||||
>decorator : Symbol(decorator, Decl(decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts, 1, 11))
|
||||
|
||||
doSomething() {
|
||||
>doSomething : Symbol(doSomething, Decl(decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts, 6, 5))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts ===
|
||||
|
||||
declare var decorator: any;
|
||||
>decorator : any
|
||||
|
||||
class MyClass {
|
||||
>MyClass : MyClass
|
||||
|
||||
constructor(test: string, test2: number) {
|
||||
>test : string
|
||||
>test2 : number
|
||||
|
||||
}
|
||||
|
||||
@decorator
|
||||
>decorator : any
|
||||
|
||||
doSomething() {
|
||||
>doSomething : () => void
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
tests/cases/conformance/es6/modules/m1.ts(2,25): error TS2652: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead.
|
||||
tests/cases/conformance/es6/modules/m1.ts(11,18): error TS2652: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead.
|
||||
tests/cases/conformance/es6/modules/m2.ts(5,8): error TS2304: Cannot find name 'Entity'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(6,8): error TS2503: Cannot find namespace 'Entity'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(8,8): error TS2339: Property 'x' does not exist on type '() => number'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(9,8): error TS2339: Property 'y' does not exist on type '() => number'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m1.ts (2 errors) ====
|
||||
|
||||
export default function Decl() {
|
||||
~~~~
|
||||
!!! error TS2652: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead.
|
||||
return 0;
|
||||
}
|
||||
|
||||
export interface Decl {
|
||||
p1: number;
|
||||
p2: number;
|
||||
}
|
||||
|
||||
export namespace Decl {
|
||||
~~~~
|
||||
!!! error TS2652: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead.
|
||||
export var x = 10;
|
||||
export var y = 20;
|
||||
|
||||
interface I {
|
||||
}
|
||||
}
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m2.ts (4 errors) ====
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
|
||||
var x: Entity;
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'Entity'.
|
||||
var y: Entity.I;
|
||||
~~~~~~
|
||||
!!! error TS2503: Cannot find namespace 'Entity'.
|
||||
|
||||
Entity.x;
|
||||
~
|
||||
!!! error TS2339: Property 'x' does not exist on type '() => number'.
|
||||
Entity.y;
|
||||
~
|
||||
!!! error TS2339: Property 'y' does not exist on type '() => number'.
|
||||
@@ -0,0 +1,50 @@
|
||||
//// [tests/cases/conformance/es6/modules/defaultExportsCannotMerge01.ts] ////
|
||||
|
||||
//// [m1.ts]
|
||||
|
||||
export default function Decl() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
export interface Decl {
|
||||
p1: number;
|
||||
p2: number;
|
||||
}
|
||||
|
||||
export namespace Decl {
|
||||
export var x = 10;
|
||||
export var y = 20;
|
||||
|
||||
interface I {
|
||||
}
|
||||
}
|
||||
|
||||
//// [m2.ts]
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
|
||||
var x: Entity;
|
||||
var y: Entity.I;
|
||||
|
||||
Entity.x;
|
||||
Entity.y;
|
||||
|
||||
//// [m1.js]
|
||||
function Decl() {
|
||||
return 0;
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = Decl;
|
||||
var Decl;
|
||||
(function (Decl) {
|
||||
Decl.x = 10;
|
||||
Decl.y = 20;
|
||||
})(Decl = exports.Decl || (exports.Decl = {}));
|
||||
//// [m2.js]
|
||||
var m1_1 = require("m1");
|
||||
m1_1.default();
|
||||
var x;
|
||||
var y;
|
||||
m1_1.default.x;
|
||||
m1_1.default.y;
|
||||
@@ -0,0 +1,44 @@
|
||||
tests/cases/conformance/es6/modules/m1.ts(2,22): error TS2652: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead.
|
||||
tests/cases/conformance/es6/modules/m1.ts(5,18): error TS2652: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead.
|
||||
tests/cases/conformance/es6/modules/m2.ts(3,1): error TS2348: Value of type 'typeof Decl' is not callable. Did you mean to include 'new'?
|
||||
tests/cases/conformance/es6/modules/m2.ts(6,8): error TS2503: Cannot find namespace 'Entity'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(8,13): error TS2339: Property 'p1' does not exist on type 'Decl'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(8,20): error TS2339: Property 'p2' does not exist on type 'Decl'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m1.ts (2 errors) ====
|
||||
|
||||
export default class Decl {
|
||||
~~~~
|
||||
!!! error TS2652: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead.
|
||||
}
|
||||
|
||||
export interface Decl {
|
||||
~~~~
|
||||
!!! error TS2652: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead.
|
||||
p1: number;
|
||||
p2: number;
|
||||
}
|
||||
|
||||
export namespace Decl {
|
||||
interface I {
|
||||
}
|
||||
}
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m2.ts (4 errors) ====
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
~~~~~~~~
|
||||
!!! error TS2348: Value of type 'typeof Decl' is not callable. Did you mean to include 'new'?
|
||||
|
||||
var x: Entity;
|
||||
var y: Entity.I;
|
||||
~~~~~~
|
||||
!!! error TS2503: Cannot find namespace 'Entity'.
|
||||
var z = new Entity();
|
||||
var sum = z.p1 + z.p2
|
||||
~~
|
||||
!!! error TS2339: Property 'p1' does not exist on type 'Decl'.
|
||||
~~
|
||||
!!! error TS2339: Property 'p2' does not exist on type 'Decl'.
|
||||
@@ -0,0 +1,42 @@
|
||||
//// [tests/cases/conformance/es6/modules/defaultExportsCannotMerge02.ts] ////
|
||||
|
||||
//// [m1.ts]
|
||||
|
||||
export default class Decl {
|
||||
}
|
||||
|
||||
export interface Decl {
|
||||
p1: number;
|
||||
p2: number;
|
||||
}
|
||||
|
||||
export namespace Decl {
|
||||
interface I {
|
||||
}
|
||||
}
|
||||
|
||||
//// [m2.ts]
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
|
||||
var x: Entity;
|
||||
var y: Entity.I;
|
||||
var z = new Entity();
|
||||
var sum = z.p1 + z.p2
|
||||
|
||||
//// [m1.js]
|
||||
var Decl = (function () {
|
||||
function Decl() {
|
||||
}
|
||||
return Decl;
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = Decl;
|
||||
//// [m2.js]
|
||||
var m1_1 = require("m1");
|
||||
m1_1.default();
|
||||
var x;
|
||||
var y;
|
||||
var z = new m1_1.default();
|
||||
var sum = z.p1 + z.p2;
|
||||
@@ -0,0 +1,47 @@
|
||||
tests/cases/conformance/es6/modules/m1.ts(2,22): error TS2652: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead.
|
||||
tests/cases/conformance/es6/modules/m1.ts(5,11): error TS2518: Only an ambient class can be merged with an interface.
|
||||
tests/cases/conformance/es6/modules/m1.ts(5,11): error TS2652: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead.
|
||||
tests/cases/conformance/es6/modules/m2.ts(3,1): error TS2348: Value of type 'typeof Decl' is not callable. Did you mean to include 'new'?
|
||||
tests/cases/conformance/es6/modules/m2.ts(6,8): error TS2503: Cannot find namespace 'Entity'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(8,13): error TS2339: Property 'p1' does not exist on type 'Decl'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(8,20): error TS2339: Property 'p2' does not exist on type 'Decl'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m1.ts (3 errors) ====
|
||||
|
||||
export default class Decl {
|
||||
~~~~
|
||||
!!! error TS2652: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead.
|
||||
}
|
||||
|
||||
interface Decl {
|
||||
~~~~
|
||||
!!! error TS2518: Only an ambient class can be merged with an interface.
|
||||
~~~~
|
||||
!!! error TS2652: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead.
|
||||
p1: number;
|
||||
p2: number;
|
||||
}
|
||||
|
||||
namespace Decl {
|
||||
interface I {
|
||||
}
|
||||
}
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m2.ts (4 errors) ====
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
~~~~~~~~
|
||||
!!! error TS2348: Value of type 'typeof Decl' is not callable. Did you mean to include 'new'?
|
||||
|
||||
var x: Entity;
|
||||
var y: Entity.I;
|
||||
~~~~~~
|
||||
!!! error TS2503: Cannot find namespace 'Entity'.
|
||||
var z = new Entity();
|
||||
var sum = z.p1 + z.p2
|
||||
~~
|
||||
!!! error TS2339: Property 'p1' does not exist on type 'Decl'.
|
||||
~~
|
||||
!!! error TS2339: Property 'p2' does not exist on type 'Decl'.
|
||||
@@ -0,0 +1,42 @@
|
||||
//// [tests/cases/conformance/es6/modules/defaultExportsCannotMerge03.ts] ////
|
||||
|
||||
//// [m1.ts]
|
||||
|
||||
export default class Decl {
|
||||
}
|
||||
|
||||
interface Decl {
|
||||
p1: number;
|
||||
p2: number;
|
||||
}
|
||||
|
||||
namespace Decl {
|
||||
interface I {
|
||||
}
|
||||
}
|
||||
|
||||
//// [m2.ts]
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
|
||||
var x: Entity;
|
||||
var y: Entity.I;
|
||||
var z = new Entity();
|
||||
var sum = z.p1 + z.p2
|
||||
|
||||
//// [m1.js]
|
||||
var Decl = (function () {
|
||||
function Decl() {
|
||||
}
|
||||
return Decl;
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = Decl;
|
||||
//// [m2.js]
|
||||
var m1_1 = require("m1");
|
||||
m1_1.default();
|
||||
var x;
|
||||
var y;
|
||||
var z = new m1_1.default();
|
||||
var sum = z.p1 + z.p2;
|
||||
@@ -0,0 +1,28 @@
|
||||
tests/cases/conformance/es6/modules/defaultExportsCannotMerge04.ts(2,25): error TS2652: Merged declaration 'Foo' cannot include a default export declaration. Consider adding a separate 'export default Foo' declaration instead.
|
||||
tests/cases/conformance/es6/modules/defaultExportsCannotMerge04.ts(5,11): error TS2652: Merged declaration 'Foo' cannot include a default export declaration. Consider adding a separate 'export default Foo' declaration instead.
|
||||
tests/cases/conformance/es6/modules/defaultExportsCannotMerge04.ts(9,11): error TS2395: Individual declarations in merged declaration 'Foo' must be all exported or all local.
|
||||
tests/cases/conformance/es6/modules/defaultExportsCannotMerge04.ts(12,18): error TS2395: Individual declarations in merged declaration 'Foo' must be all exported or all local.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/modules/defaultExportsCannotMerge04.ts (4 errors) ====
|
||||
|
||||
export default function Foo() {
|
||||
~~~
|
||||
!!! error TS2652: Merged declaration 'Foo' cannot include a default export declaration. Consider adding a separate 'export default Foo' declaration instead.
|
||||
}
|
||||
|
||||
namespace Foo {
|
||||
~~~
|
||||
!!! error TS2652: Merged declaration 'Foo' cannot include a default export declaration. Consider adding a separate 'export default Foo' declaration instead.
|
||||
export var x;
|
||||
}
|
||||
|
||||
interface Foo {
|
||||
~~~
|
||||
!!! error TS2395: Individual declarations in merged declaration 'Foo' must be all exported or all local.
|
||||
}
|
||||
|
||||
export interface Foo {
|
||||
~~~
|
||||
!!! error TS2395: Individual declarations in merged declaration 'Foo' must be all exported or all local.
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [defaultExportsCannotMerge04.ts]
|
||||
|
||||
export default function Foo() {
|
||||
}
|
||||
|
||||
namespace Foo {
|
||||
export var x;
|
||||
}
|
||||
|
||||
interface Foo {
|
||||
}
|
||||
|
||||
export interface Foo {
|
||||
}
|
||||
|
||||
//// [defaultExportsCannotMerge04.js]
|
||||
function Foo() {
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = Foo;
|
||||
var Foo;
|
||||
(function (Foo) {
|
||||
})(Foo || (Foo = {}));
|
||||
@@ -1,21 +1,21 @@
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(24,15): error TS2395: Individual declarations in merged declaration I must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(25,22): error TS2395: Individual declarations in merged declaration I must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(26,22): error TS2395: Individual declarations in merged declaration E must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(27,15): error TS2395: Individual declarations in merged declaration E must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(32,12): error TS2395: Individual declarations in merged declaration inst must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(35,19): error TS2395: Individual declarations in merged declaration inst must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(42,9): error TS2395: Individual declarations in merged declaration v must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(43,16): error TS2395: Individual declarations in merged declaration v must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(44,9): error TS2395: Individual declarations in merged declaration w must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(45,16): error TS2395: Individual declarations in merged declaration w must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(49,12): error TS2395: Individual declarations in merged declaration F must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(24,15): error TS2395: Individual declarations in merged declaration 'I' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(25,22): error TS2395: Individual declarations in merged declaration 'I' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(26,22): error TS2395: Individual declarations in merged declaration 'E' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(27,15): error TS2395: Individual declarations in merged declaration 'E' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(32,12): error TS2395: Individual declarations in merged declaration 'inst' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(35,19): error TS2395: Individual declarations in merged declaration 'inst' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(42,9): error TS2395: Individual declarations in merged declaration 'v' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(43,16): error TS2395: Individual declarations in merged declaration 'v' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(44,9): error TS2395: Individual declarations in merged declaration 'w' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(45,16): error TS2395: Individual declarations in merged declaration 'w' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(49,12): error TS2395: Individual declarations in merged declaration 'F' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(49,12): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(52,21): error TS2395: Individual declarations in merged declaration F must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(56,11): error TS2395: Individual declarations in merged declaration C must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(57,12): error TS2395: Individual declarations in merged declaration C must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(58,19): error TS2395: Individual declarations in merged declaration C must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(64,11): error TS2395: Individual declarations in merged declaration D must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(65,18): error TS2395: Individual declarations in merged declaration D must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(52,21): error TS2395: Individual declarations in merged declaration 'F' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(56,11): error TS2395: Individual declarations in merged declaration 'C' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(57,12): error TS2395: Individual declarations in merged declaration 'C' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(58,19): error TS2395: Individual declarations in merged declaration 'C' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(64,11): error TS2395: Individual declarations in merged declaration 'D' must be all exported or all local.
|
||||
tests/cases/compiler/duplicateSymbolsExportMatching.ts(65,18): error TS2395: Individual declarations in merged declaration 'D' must be all exported or all local.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateSymbolsExportMatching.ts (18 errors) ====
|
||||
@@ -44,28 +44,28 @@ tests/cases/compiler/duplicateSymbolsExportMatching.ts(65,18): error TS2395: Ind
|
||||
module N2 {
|
||||
interface I { }
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration I must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'I' must be all exported or all local.
|
||||
export interface I { } // error
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration I must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'I' must be all exported or all local.
|
||||
export interface E { }
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration E must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'E' must be all exported or all local.
|
||||
interface E { } // error
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration E must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'E' must be all exported or all local.
|
||||
}
|
||||
|
||||
// Should report error only once for instantiated module
|
||||
module M {
|
||||
module inst {
|
||||
~~~~
|
||||
!!! error TS2395: Individual declarations in merged declaration inst must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'inst' must be all exported or all local.
|
||||
var t;
|
||||
}
|
||||
export module inst { // one error
|
||||
~~~~
|
||||
!!! error TS2395: Individual declarations in merged declaration inst must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'inst' must be all exported or all local.
|
||||
var t;
|
||||
}
|
||||
}
|
||||
@@ -74,41 +74,41 @@ tests/cases/compiler/duplicateSymbolsExportMatching.ts(65,18): error TS2395: Ind
|
||||
module M2 {
|
||||
var v: string;
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration v must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'v' must be all exported or all local.
|
||||
export var v: string; // one error (visibility)
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration v must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'v' must be all exported or all local.
|
||||
var w: number;
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration w must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'w' must be all exported or all local.
|
||||
export var w: string; // two errors (visibility and type mismatch)
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration w must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'w' must be all exported or all local.
|
||||
}
|
||||
|
||||
module M {
|
||||
module F {
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration F must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'F' must be all exported or all local.
|
||||
~
|
||||
!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged
|
||||
var t;
|
||||
}
|
||||
export function F() { } // Only one error for duplicate identifier (don't consider visibility)
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration F must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'F' must be all exported or all local.
|
||||
}
|
||||
|
||||
module M {
|
||||
class C { }
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration C must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'C' must be all exported or all local.
|
||||
module C { }
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration C must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'C' must be all exported or all local.
|
||||
export module C { // Two visibility errors (one for the clodule symbol, and one for the merged container symbol)
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration C must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'C' must be all exported or all local.
|
||||
var t;
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ tests/cases/compiler/duplicateSymbolsExportMatching.ts(65,18): error TS2395: Ind
|
||||
// Top level
|
||||
interface D { }
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration D must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'D' must be all exported or all local.
|
||||
export interface D { }
|
||||
~
|
||||
!!! error TS2395: Individual declarations in merged declaration D must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'D' must be all exported or all local.
|
||||
@@ -1,10 +1,9 @@
|
||||
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(1,9): error TS1016: A required parameter cannot follow an optional parameter.
|
||||
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(2,8): error TS1047: A rest parameter cannot be optional.
|
||||
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(4,5): error TS1048: A rest parameter cannot have an initializer.
|
||||
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(7,12): error TS1016: A required parameter cannot follow an optional parameter.
|
||||
|
||||
|
||||
==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts (4 errors) ====
|
||||
==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts (3 errors) ====
|
||||
(arg1?, arg2) => 101;
|
||||
~~~~
|
||||
!!! error TS1016: A required parameter cannot follow an optional parameter.
|
||||
@@ -16,7 +15,5 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(7,12): error TS1016
|
||||
~~~
|
||||
!!! error TS1048: A rest parameter cannot have an initializer.
|
||||
|
||||
// Non optional parameter following an optional one
|
||||
(arg1 = 1, arg2) => 1;
|
||||
~~~~
|
||||
!!! error TS1016: A required parameter cannot follow an optional parameter.
|
||||
// Uninitialized parameter makes the initialized one required
|
||||
(arg1 = 1, arg2) => 1;
|
||||
@@ -4,7 +4,7 @@
|
||||
(...arg) => 103;
|
||||
(...arg:number [] = []) => 104;
|
||||
|
||||
// Non optional parameter following an optional one
|
||||
// Uninitialized parameter makes the initialized one required
|
||||
(arg1 = 1, arg2) => 1;
|
||||
|
||||
//// [fatarrowfunctionsOptionalArgsErrors1.js]
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
return 104;
|
||||
});
|
||||
// Non optional parameter following an optional one
|
||||
// Uninitialized parameter makes the initialized one required
|
||||
(function (arg1, arg2) {
|
||||
if (arg1 === void 0) { arg1 = 1; }
|
||||
return 1;
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
tests/cases/compiler/indexTypeCheck.ts(2,2): error TS1021: An index signature must have a type annotation.
|
||||
tests/cases/compiler/indexTypeCheck.ts(3,2): error TS1021: An index signature must have a type annotation.
|
||||
tests/cases/compiler/indexTypeCheck.ts(17,2): error TS2413: Numeric index type 'number' is not assignable to string index type 'string'.
|
||||
tests/cases/compiler/indexTypeCheck.ts(22,2): error TS2413: Numeric index type 'Orange' is not assignable to string index type 'Yellow'.
|
||||
tests/cases/compiler/indexTypeCheck.ts(27,2): error TS2413: Numeric index type 'number' is not assignable to string index type 'string'.
|
||||
tests/cases/compiler/indexTypeCheck.ts(32,3): error TS1096: An index signature must have exactly one parameter.
|
||||
tests/cases/compiler/indexTypeCheck.ts(36,3): error TS1023: An index signature parameter type must be 'string' or 'number'.
|
||||
tests/cases/compiler/indexTypeCheck.ts(51,1): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol, or 'any'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/indexTypeCheck.ts (8 errors) ====
|
||||
==== tests/cases/compiler/indexTypeCheck.ts (7 errors) ====
|
||||
interface Red {
|
||||
[n:number]; // ok
|
||||
~~~~~~~~~~~
|
||||
@@ -37,8 +36,6 @@ tests/cases/compiler/indexTypeCheck.ts(51,1): error TS2342: An index expression
|
||||
|
||||
interface Green {
|
||||
[n:number]: Orange; // error
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2413: Numeric index type 'Orange' is not assignable to string index type 'Yellow'.
|
||||
[s:string]: Yellow; // ok
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ function foo<T extends { m(p: string): number }>(x: T): T {
|
||||
}
|
||||
|
||||
foo({ m(x) { return x.length } });
|
||||
>foo({ m(x) { return x.length } }) : { }
|
||||
>foo({ m(x) { return x.length } }) : { m(x: string): number; }
|
||||
>foo : <T extends { m(p: string): number; }>(x: T) => T
|
||||
>{ m(x) { return x.length } } : { m(x: string): number; }
|
||||
>m : (x: string) => number
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//// [inferringAnyFunctionType1.ts]
|
||||
function f<T extends { "0": (p1: number) => number }>(p: T): T {
|
||||
return p;
|
||||
}
|
||||
|
||||
var v = f([x => x]);
|
||||
|
||||
//// [inferringAnyFunctionType1.js]
|
||||
function f(p) {
|
||||
return p;
|
||||
}
|
||||
var v = f([function (x) { return x; }]);
|
||||
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/compiler/inferringAnyFunctionType1.ts ===
|
||||
function f<T extends { "0": (p1: number) => number }>(p: T): T {
|
||||
>f : Symbol(f, Decl(inferringAnyFunctionType1.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType1.ts, 0, 11))
|
||||
>p1 : Symbol(p1, Decl(inferringAnyFunctionType1.ts, 0, 29))
|
||||
>p : Symbol(p, Decl(inferringAnyFunctionType1.ts, 0, 54))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType1.ts, 0, 11))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType1.ts, 0, 11))
|
||||
|
||||
return p;
|
||||
>p : Symbol(p, Decl(inferringAnyFunctionType1.ts, 0, 54))
|
||||
}
|
||||
|
||||
var v = f([x => x]);
|
||||
>v : Symbol(v, Decl(inferringAnyFunctionType1.ts, 4, 3))
|
||||
>f : Symbol(f, Decl(inferringAnyFunctionType1.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(inferringAnyFunctionType1.ts, 4, 11))
|
||||
>x : Symbol(x, Decl(inferringAnyFunctionType1.ts, 4, 11))
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/compiler/inferringAnyFunctionType1.ts ===
|
||||
function f<T extends { "0": (p1: number) => number }>(p: T): T {
|
||||
>f : <T extends { "0": (p1: number) => number; }>(p: T) => T
|
||||
>T : T
|
||||
>p1 : number
|
||||
>p : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
return p;
|
||||
>p : T
|
||||
}
|
||||
|
||||
var v = f([x => x]);
|
||||
>v : [(x: number) => number]
|
||||
>f([x => x]) : [(x: number) => number]
|
||||
>f : <T extends { "0": (p1: number) => number; }>(p: T) => T
|
||||
>[x => x] : [(x: number) => number]
|
||||
>x => x : (x: number) => number
|
||||
>x : number
|
||||
>x : number
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//// [inferringAnyFunctionType2.ts]
|
||||
function f<T extends [(p1: number) => number]>(p: T): T {
|
||||
return p;
|
||||
}
|
||||
|
||||
var v = f([x => x]);
|
||||
|
||||
//// [inferringAnyFunctionType2.js]
|
||||
function f(p) {
|
||||
return p;
|
||||
}
|
||||
var v = f([function (x) { return x; }]);
|
||||
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/compiler/inferringAnyFunctionType2.ts ===
|
||||
function f<T extends [(p1: number) => number]>(p: T): T {
|
||||
>f : Symbol(f, Decl(inferringAnyFunctionType2.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType2.ts, 0, 11))
|
||||
>p1 : Symbol(p1, Decl(inferringAnyFunctionType2.ts, 0, 23))
|
||||
>p : Symbol(p, Decl(inferringAnyFunctionType2.ts, 0, 47))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType2.ts, 0, 11))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType2.ts, 0, 11))
|
||||
|
||||
return p;
|
||||
>p : Symbol(p, Decl(inferringAnyFunctionType2.ts, 0, 47))
|
||||
}
|
||||
|
||||
var v = f([x => x]);
|
||||
>v : Symbol(v, Decl(inferringAnyFunctionType2.ts, 4, 3))
|
||||
>f : Symbol(f, Decl(inferringAnyFunctionType2.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(inferringAnyFunctionType2.ts, 4, 11))
|
||||
>x : Symbol(x, Decl(inferringAnyFunctionType2.ts, 4, 11))
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/compiler/inferringAnyFunctionType2.ts ===
|
||||
function f<T extends [(p1: number) => number]>(p: T): T {
|
||||
>f : <T extends [(p1: number) => number]>(p: T) => T
|
||||
>T : T
|
||||
>p1 : number
|
||||
>p : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
return p;
|
||||
>p : T
|
||||
}
|
||||
|
||||
var v = f([x => x]);
|
||||
>v : [(x: number) => number]
|
||||
>f([x => x]) : [(x: number) => number]
|
||||
>f : <T extends [(p1: number) => number]>(p: T) => T
|
||||
>[x => x] : [(x: number) => number]
|
||||
>x => x : (x: number) => number
|
||||
>x : number
|
||||
>x : number
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//// [inferringAnyFunctionType3.ts]
|
||||
function f<T extends ((p1: number) => number)[]>(p: T): T {
|
||||
return p;
|
||||
}
|
||||
|
||||
var v = f([x => x]);
|
||||
|
||||
//// [inferringAnyFunctionType3.js]
|
||||
function f(p) {
|
||||
return p;
|
||||
}
|
||||
var v = f([function (x) { return x; }]);
|
||||
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/compiler/inferringAnyFunctionType3.ts ===
|
||||
function f<T extends ((p1: number) => number)[]>(p: T): T {
|
||||
>f : Symbol(f, Decl(inferringAnyFunctionType3.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType3.ts, 0, 11))
|
||||
>p1 : Symbol(p1, Decl(inferringAnyFunctionType3.ts, 0, 23))
|
||||
>p : Symbol(p, Decl(inferringAnyFunctionType3.ts, 0, 49))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType3.ts, 0, 11))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType3.ts, 0, 11))
|
||||
|
||||
return p;
|
||||
>p : Symbol(p, Decl(inferringAnyFunctionType3.ts, 0, 49))
|
||||
}
|
||||
|
||||
var v = f([x => x]);
|
||||
>v : Symbol(v, Decl(inferringAnyFunctionType3.ts, 4, 3))
|
||||
>f : Symbol(f, Decl(inferringAnyFunctionType3.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(inferringAnyFunctionType3.ts, 4, 11))
|
||||
>x : Symbol(x, Decl(inferringAnyFunctionType3.ts, 4, 11))
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/compiler/inferringAnyFunctionType3.ts ===
|
||||
function f<T extends ((p1: number) => number)[]>(p: T): T {
|
||||
>f : <T extends ((p1: number) => number)[]>(p: T) => T
|
||||
>T : T
|
||||
>p1 : number
|
||||
>p : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
return p;
|
||||
>p : T
|
||||
}
|
||||
|
||||
var v = f([x => x]);
|
||||
>v : ((x: number) => number)[]
|
||||
>f([x => x]) : ((x: number) => number)[]
|
||||
>f : <T extends ((p1: number) => number)[]>(p: T) => T
|
||||
>[x => x] : ((x: number) => number)[]
|
||||
>x => x : (x: number) => number
|
||||
>x : number
|
||||
>x : number
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//// [inferringAnyFunctionType4.ts]
|
||||
function f<T extends (p1: number) => number>(p: T): T {
|
||||
return p;
|
||||
}
|
||||
|
||||
var v = f(x => x);
|
||||
|
||||
//// [inferringAnyFunctionType4.js]
|
||||
function f(p) {
|
||||
return p;
|
||||
}
|
||||
var v = f(function (x) { return x; });
|
||||
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/compiler/inferringAnyFunctionType4.ts ===
|
||||
function f<T extends (p1: number) => number>(p: T): T {
|
||||
>f : Symbol(f, Decl(inferringAnyFunctionType4.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType4.ts, 0, 11))
|
||||
>p1 : Symbol(p1, Decl(inferringAnyFunctionType4.ts, 0, 22))
|
||||
>p : Symbol(p, Decl(inferringAnyFunctionType4.ts, 0, 45))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType4.ts, 0, 11))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType4.ts, 0, 11))
|
||||
|
||||
return p;
|
||||
>p : Symbol(p, Decl(inferringAnyFunctionType4.ts, 0, 45))
|
||||
}
|
||||
|
||||
var v = f(x => x);
|
||||
>v : Symbol(v, Decl(inferringAnyFunctionType4.ts, 4, 3))
|
||||
>f : Symbol(f, Decl(inferringAnyFunctionType4.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(inferringAnyFunctionType4.ts, 4, 10))
|
||||
>x : Symbol(x, Decl(inferringAnyFunctionType4.ts, 4, 10))
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
=== tests/cases/compiler/inferringAnyFunctionType4.ts ===
|
||||
function f<T extends (p1: number) => number>(p: T): T {
|
||||
>f : <T extends (p1: number) => number>(p: T) => T
|
||||
>T : T
|
||||
>p1 : number
|
||||
>p : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
return p;
|
||||
>p : T
|
||||
}
|
||||
|
||||
var v = f(x => x);
|
||||
>v : (x: number) => number
|
||||
>f(x => x) : (x: number) => number
|
||||
>f : <T extends (p1: number) => number>(p: T) => T
|
||||
>x => x : (x: number) => number
|
||||
>x : number
|
||||
>x : number
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//// [inferringAnyFunctionType5.ts]
|
||||
function f<T extends { q: (p1: number) => number }>(p: T): T {
|
||||
return p;
|
||||
}
|
||||
|
||||
var v = f({ q: x => x });
|
||||
|
||||
//// [inferringAnyFunctionType5.js]
|
||||
function f(p) {
|
||||
return p;
|
||||
}
|
||||
var v = f({ q: function (x) { return x; } });
|
||||
@@ -0,0 +1,21 @@
|
||||
=== tests/cases/compiler/inferringAnyFunctionType5.ts ===
|
||||
function f<T extends { q: (p1: number) => number }>(p: T): T {
|
||||
>f : Symbol(f, Decl(inferringAnyFunctionType5.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType5.ts, 0, 11))
|
||||
>q : Symbol(q, Decl(inferringAnyFunctionType5.ts, 0, 22))
|
||||
>p1 : Symbol(p1, Decl(inferringAnyFunctionType5.ts, 0, 27))
|
||||
>p : Symbol(p, Decl(inferringAnyFunctionType5.ts, 0, 52))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType5.ts, 0, 11))
|
||||
>T : Symbol(T, Decl(inferringAnyFunctionType5.ts, 0, 11))
|
||||
|
||||
return p;
|
||||
>p : Symbol(p, Decl(inferringAnyFunctionType5.ts, 0, 52))
|
||||
}
|
||||
|
||||
var v = f({ q: x => x });
|
||||
>v : Symbol(v, Decl(inferringAnyFunctionType5.ts, 4, 3))
|
||||
>f : Symbol(f, Decl(inferringAnyFunctionType5.ts, 0, 0))
|
||||
>q : Symbol(q, Decl(inferringAnyFunctionType5.ts, 4, 11))
|
||||
>x : Symbol(x, Decl(inferringAnyFunctionType5.ts, 4, 14))
|
||||
>x : Symbol(x, Decl(inferringAnyFunctionType5.ts, 4, 14))
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
=== tests/cases/compiler/inferringAnyFunctionType5.ts ===
|
||||
function f<T extends { q: (p1: number) => number }>(p: T): T {
|
||||
>f : <T extends { q: (p1: number) => number; }>(p: T) => T
|
||||
>T : T
|
||||
>q : (p1: number) => number
|
||||
>p1 : number
|
||||
>p : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
return p;
|
||||
>p : T
|
||||
}
|
||||
|
||||
var v = f({ q: x => x });
|
||||
>v : { q: (x: number) => number; }
|
||||
>f({ q: x => x }) : { q: (x: number) => number; }
|
||||
>f : <T extends { q: (p1: number) => number; }>(p: T) => T
|
||||
>{ q: x => x } : { q: (x: number) => number; }
|
||||
>q : (x: number) => number
|
||||
>x => x : (x: number) => number
|
||||
>x : number
|
||||
>x : number
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/compiler/innerModExport2.ts(5,5): error TS2304: Cannot find name 'module'.
|
||||
tests/cases/compiler/innerModExport2.ts(5,12): error TS1005: ';' expected.
|
||||
tests/cases/compiler/innerModExport2.ts(7,20): error TS2395: Individual declarations in merged declaration export_var must be all exported or all local.
|
||||
tests/cases/compiler/innerModExport2.ts(13,9): error TS2395: Individual declarations in merged declaration export_var must be all exported or all local.
|
||||
tests/cases/compiler/innerModExport2.ts(7,20): error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local.
|
||||
tests/cases/compiler/innerModExport2.ts(13,9): error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local.
|
||||
tests/cases/compiler/innerModExport2.ts(20,7): error TS2339: Property 'NonExportFunc' does not exist on type 'typeof Outer'.
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ tests/cases/compiler/innerModExport2.ts(20,7): error TS2339: Property 'NonExport
|
||||
var non_export_var = 0;
|
||||
export var export_var = 1;
|
||||
~~~~~~~~~~
|
||||
!!! error TS2395: Individual declarations in merged declaration export_var must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local.
|
||||
|
||||
function NonExportFunc() { return 0; }
|
||||
|
||||
@@ -26,7 +26,7 @@ tests/cases/compiler/innerModExport2.ts(20,7): error TS2339: Property 'NonExport
|
||||
}
|
||||
var export_var: number;
|
||||
~~~~~~~~~~
|
||||
!!! error TS2395: Individual declarations in merged declaration export_var must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local.
|
||||
|
||||
export var outer_var_export = 0;
|
||||
export function outerFuncExport() { return 0; }
|
||||
|
||||
@@ -29,15 +29,7 @@ tests/cases/compiler/intTypeCheck.ts(134,5): error TS2322: Type 'boolean' is not
|
||||
tests/cases/compiler/intTypeCheck.ts(134,21): error TS1109: Expression expected.
|
||||
tests/cases/compiler/intTypeCheck.ts(134,22): error TS2304: Cannot find name 'i3'.
|
||||
tests/cases/compiler/intTypeCheck.ts(135,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
tests/cases/compiler/intTypeCheck.ts(141,5): error TS2322: Type 'Object' is not assignable to type 'i4'.
|
||||
Index signature is missing in type 'Object'.
|
||||
tests/cases/compiler/intTypeCheck.ts(142,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
tests/cases/compiler/intTypeCheck.ts(143,5): error TS2322: Type 'Base' is not assignable to type 'i4'.
|
||||
Index signature is missing in type 'Base'.
|
||||
tests/cases/compiler/intTypeCheck.ts(145,5): error TS2322: Type '() => void' is not assignable to type 'i4'.
|
||||
Index signature is missing in type '() => void'.
|
||||
tests/cases/compiler/intTypeCheck.ts(148,5): error TS2322: Type 'boolean' is not assignable to type 'i4'.
|
||||
Index signature is missing in type 'Boolean'.
|
||||
tests/cases/compiler/intTypeCheck.ts(148,21): error TS1109: Expression expected.
|
||||
tests/cases/compiler/intTypeCheck.ts(148,22): error TS2304: Cannot find name 'i4'.
|
||||
tests/cases/compiler/intTypeCheck.ts(149,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
@@ -73,21 +65,13 @@ tests/cases/compiler/intTypeCheck.ts(190,5): error TS2322: Type 'boolean' is not
|
||||
tests/cases/compiler/intTypeCheck.ts(190,21): error TS1109: Expression expected.
|
||||
tests/cases/compiler/intTypeCheck.ts(190,22): error TS2304: Cannot find name 'i7'.
|
||||
tests/cases/compiler/intTypeCheck.ts(191,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
tests/cases/compiler/intTypeCheck.ts(197,5): error TS2322: Type 'Object' is not assignable to type 'i8'.
|
||||
Index signature is missing in type 'Object'.
|
||||
tests/cases/compiler/intTypeCheck.ts(198,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
tests/cases/compiler/intTypeCheck.ts(199,5): error TS2322: Type 'Base' is not assignable to type 'i8'.
|
||||
Index signature is missing in type 'Base'.
|
||||
tests/cases/compiler/intTypeCheck.ts(201,5): error TS2322: Type '() => void' is not assignable to type 'i8'.
|
||||
Index signature is missing in type '() => void'.
|
||||
tests/cases/compiler/intTypeCheck.ts(204,5): error TS2322: Type 'boolean' is not assignable to type 'i8'.
|
||||
Index signature is missing in type 'Boolean'.
|
||||
tests/cases/compiler/intTypeCheck.ts(204,21): error TS1109: Expression expected.
|
||||
tests/cases/compiler/intTypeCheck.ts(204,22): error TS2304: Cannot find name 'i8'.
|
||||
tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/intTypeCheck.ts (69 errors) ====
|
||||
==== tests/cases/compiler/intTypeCheck.ts (61 errors) ====
|
||||
interface i1 {
|
||||
//Property Signatures
|
||||
p;
|
||||
@@ -287,27 +271,15 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
|
||||
var obj33: i4;
|
||||
var obj34: i4 = {};
|
||||
var obj35: i4 = new Object();
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'i4'.
|
||||
!!! error TS2322: Index signature is missing in type 'Object'.
|
||||
var obj36: i4 = new obj33;
|
||||
~~~~~~~~~
|
||||
!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
var obj37: i4 = new Base;
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'i4'.
|
||||
!!! error TS2322: Index signature is missing in type 'Base'.
|
||||
var obj38: i4 = null;
|
||||
var obj39: i4 = function () { };
|
||||
~~~~~
|
||||
!!! error TS2322: Type '() => void' is not assignable to type 'i4'.
|
||||
!!! error TS2322: Index signature is missing in type '() => void'.
|
||||
//var obj40: i4 = function foo() { };
|
||||
var obj41: i4 = <i4> anyVar;
|
||||
var obj42: i4 = new <i4> anyVar;
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'boolean' is not assignable to type 'i4'.
|
||||
!!! error TS2322: Index signature is missing in type 'Boolean'.
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
~~
|
||||
@@ -421,27 +393,15 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
|
||||
var obj77: i8;
|
||||
var obj78: i8 = {};
|
||||
var obj79: i8 = new Object();
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'i8'.
|
||||
!!! error TS2322: Index signature is missing in type 'Object'.
|
||||
var obj80: i8 = new obj77;
|
||||
~~~~~~~~~
|
||||
!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
var obj81: i8 = new Base;
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'i8'.
|
||||
!!! error TS2322: Index signature is missing in type 'Base'.
|
||||
var obj82: i8 = null;
|
||||
var obj83: i8 = function () { };
|
||||
~~~~~
|
||||
!!! error TS2322: Type '() => void' is not assignable to type 'i8'.
|
||||
!!! error TS2322: Index signature is missing in type '() => void'.
|
||||
//var obj84: i8 = function foo() { };
|
||||
var obj85: i8 = <i8> anyVar;
|
||||
var obj86: i8 = new <i8> anyVar;
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'boolean' is not assignable to type 'i8'.
|
||||
!!! error TS2322: Index signature is missing in type 'Boolean'.
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
~~
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
error TS5043: Option 'sourceMap' cannot be specified with option 'isolatedModules'.
|
||||
|
||||
|
||||
!!! error TS5043: Option 'sourceMap' cannot be specified with option 'isolatedModules'.
|
||||
==== tests/cases/compiler/isolatedModulesSourceMap.ts (0 errors) ====
|
||||
|
||||
export var x;
|
||||
@@ -1,7 +1,7 @@
|
||||
//// [isolatedModulesSourceMap.ts]
|
||||
|
||||
export var x;
|
||||
export var x = 1;
|
||||
|
||||
//// [isolatedModulesSourceMap.js]
|
||||
export var x;
|
||||
export var x = 1;
|
||||
//# sourceMappingURL=isolatedModulesSourceMap.js.map
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [isolatedModulesSourceMap.js.map]
|
||||
{"version":3,"file":"isolatedModulesSourceMap.js","sourceRoot":"","sources":["isolatedModulesSourceMap.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,CAAC"}
|
||||
{"version":3,"file":"isolatedModulesSourceMap.js","sourceRoot":"","sources":["isolatedModulesSourceMap.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,GAAG,CAAC,CAAC"}
|
||||
@@ -8,20 +8,26 @@ sources: isolatedModulesSourceMap.ts
|
||||
emittedFile:tests/cases/compiler/isolatedModulesSourceMap.js
|
||||
sourceFile:isolatedModulesSourceMap.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>export var x;
|
||||
>>>export var x = 1;
|
||||
1 >
|
||||
2 >^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
4 > ^^^
|
||||
5 > ^
|
||||
6 > ^
|
||||
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
2 >export var
|
||||
3 > x
|
||||
4 > ;
|
||||
4 > =
|
||||
5 > 1
|
||||
6 > ;
|
||||
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
|
||||
2 >Emitted(1, 12) Source(2, 12) + SourceIndex(0)
|
||||
3 >Emitted(1, 13) Source(2, 13) + SourceIndex(0)
|
||||
4 >Emitted(1, 14) Source(2, 14) + SourceIndex(0)
|
||||
4 >Emitted(1, 16) Source(2, 16) + SourceIndex(0)
|
||||
5 >Emitted(1, 17) Source(2, 17) + SourceIndex(0)
|
||||
6 >Emitted(1, 18) Source(2, 18) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=isolatedModulesSourceMap.js.map
|
||||
@@ -0,0 +1,5 @@
|
||||
=== tests/cases/compiler/isolatedModulesSourceMap.ts ===
|
||||
|
||||
export var x = 1;
|
||||
>x : Symbol(x, Decl(isolatedModulesSourceMap.ts, 1, 10))
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/isolatedModulesSourceMap.ts ===
|
||||
|
||||
export var x = 1;
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
tests/cases/compiler/consumer.tsx(5,17): error TS2604: JSX element type 'BaseComponent' does not have any construct or call signatures.
|
||||
|
||||
|
||||
==== tests/cases/compiler/consumer.tsx (1 errors) ====
|
||||
/// <reference path="component.d.ts" />
|
||||
import BaseComponent = require('BaseComponent');
|
||||
class TestComponent extends React.Component<any, {}> {
|
||||
render() {
|
||||
return <BaseComponent />;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2604: JSX element type 'BaseComponent' does not have any construct or call signatures.
|
||||
}
|
||||
}
|
||||
|
||||
==== tests/cases/compiler/component.d.ts (0 errors) ====
|
||||
|
||||
declare module JSX {
|
||||
interface ElementAttributesProperty { props; }
|
||||
}
|
||||
declare module React {
|
||||
class Component<T, U> { }
|
||||
}
|
||||
declare module "BaseComponent" {
|
||||
var base: React.Component<any, {}>;
|
||||
export = base;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
//// [tests/cases/compiler/jsxViaImport.tsx] ////
|
||||
|
||||
//// [component.d.ts]
|
||||
|
||||
declare module JSX {
|
||||
interface ElementAttributesProperty { props; }
|
||||
}
|
||||
declare module React {
|
||||
class Component<T, U> { }
|
||||
}
|
||||
declare module "BaseComponent" {
|
||||
var base: React.Component<any, {}>;
|
||||
export = base;
|
||||
}
|
||||
|
||||
//// [consumer.tsx]
|
||||
/// <reference path="component.d.ts" />
|
||||
import BaseComponent = require('BaseComponent');
|
||||
class TestComponent extends React.Component<any, {}> {
|
||||
render() {
|
||||
return <BaseComponent />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [consumer.jsx]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
/// <reference path="component.d.ts" />
|
||||
var BaseComponent = require('BaseComponent');
|
||||
var TestComponent = (function (_super) {
|
||||
__extends(TestComponent, _super);
|
||||
function TestComponent() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
TestComponent.prototype.render = function () {
|
||||
return <BaseComponent />;
|
||||
};
|
||||
return TestComponent;
|
||||
})(React.Component);
|
||||
@@ -0,0 +1,31 @@
|
||||
tests/cases/conformance/es6/modules/m1.ts(2,22): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/es6/modules/m1.ts(6,25): error TS2300: Duplicate identifier 'bar'.
|
||||
tests/cases/conformance/es6/modules/m1.ts(11,1): error TS2300: Duplicate identifier 'default'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(3,1): error TS2348: Value of type 'typeof foo' is not callable. Did you mean to include 'new'?
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m1.ts (3 errors) ====
|
||||
|
||||
export default class foo {
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
}
|
||||
|
||||
export default function bar() {
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
|
||||
}
|
||||
|
||||
var x = 10;
|
||||
export default x;
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'default'.
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m2.ts (1 errors) ====
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
~~~~~~~~
|
||||
!!! error TS2348: Value of type 'typeof foo' is not callable. Did you mean to include 'new'?
|
||||
@@ -0,0 +1,38 @@
|
||||
//// [tests/cases/conformance/es6/modules/multipleDefaultExports01.ts] ////
|
||||
|
||||
//// [m1.ts]
|
||||
|
||||
export default class foo {
|
||||
|
||||
}
|
||||
|
||||
export default function bar() {
|
||||
|
||||
}
|
||||
|
||||
var x = 10;
|
||||
export default x;
|
||||
|
||||
//// [m2.ts]
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
|
||||
//// [m1.js]
|
||||
var foo = (function () {
|
||||
function foo() {
|
||||
}
|
||||
return foo;
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = foo;
|
||||
function bar() {
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = bar;
|
||||
var x = 10;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = x;
|
||||
//// [m2.js]
|
||||
var m1_1 = require("m1");
|
||||
m1_1.default();
|
||||
@@ -0,0 +1,22 @@
|
||||
tests/cases/conformance/es6/modules/m1.ts(2,25): error TS2393: Duplicate function implementation.
|
||||
tests/cases/conformance/es6/modules/m1.ts(6,25): error TS2393: Duplicate function implementation.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m1.ts (2 errors) ====
|
||||
|
||||
export default function foo() {
|
||||
~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
|
||||
}
|
||||
|
||||
export default function bar() {
|
||||
~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
|
||||
}
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m2.ts (0 errors) ====
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
@@ -0,0 +1,29 @@
|
||||
//// [tests/cases/conformance/es6/modules/multipleDefaultExports02.ts] ////
|
||||
|
||||
//// [m1.ts]
|
||||
|
||||
export default function foo() {
|
||||
|
||||
}
|
||||
|
||||
export default function bar() {
|
||||
|
||||
}
|
||||
|
||||
//// [m2.ts]
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
|
||||
//// [m1.js]
|
||||
function foo() {
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = foo;
|
||||
function bar() {
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = bar;
|
||||
//// [m2.js]
|
||||
var m1_1 = require("m1");
|
||||
m1_1.default();
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/multivar.ts(6,19): error TS2395: Individual declarations in merged declaration b2 must be all exported or all local.
|
||||
tests/cases/compiler/multivar.ts(22,9): error TS2395: Individual declarations in merged declaration b2 must be all exported or all local.
|
||||
tests/cases/compiler/multivar.ts(6,19): error TS2395: Individual declarations in merged declaration 'b2' must be all exported or all local.
|
||||
tests/cases/compiler/multivar.ts(22,9): error TS2395: Individual declarations in merged declaration 'b2' must be all exported or all local.
|
||||
|
||||
|
||||
==== tests/cases/compiler/multivar.ts (2 errors) ====
|
||||
@@ -10,7 +10,7 @@ tests/cases/compiler/multivar.ts(22,9): error TS2395: Individual declarations in
|
||||
|
||||
export var a, b2: number = 10, b;
|
||||
~~
|
||||
!!! error TS2395: Individual declarations in merged declaration b2 must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'b2' must be all exported or all local.
|
||||
var m1;
|
||||
var a2, b22: number = 10, b222;
|
||||
var m3;
|
||||
@@ -28,7 +28,7 @@ tests/cases/compiler/multivar.ts(22,9): error TS2395: Individual declarations in
|
||||
declare var d1, d2;
|
||||
var b2;
|
||||
~~
|
||||
!!! error TS2395: Individual declarations in merged declaration b2 must be all exported or all local.
|
||||
!!! error TS2395: Individual declarations in merged declaration 'b2' must be all exported or all local.
|
||||
|
||||
declare var v1;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/optionalParamArgsTest.ts(31,12): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/optionalParamArgsTest.ts(35,12): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/optionalParamArgsTest.ts(35,47): error TS1016: A required parameter cannot follow an optional parameter.
|
||||
tests/cases/compiler/optionalParamArgsTest.ts(34,12): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/optionalParamArgsTest.ts(98,1): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/optionalParamArgsTest.ts(99,1): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/optionalParamArgsTest.ts(100,1): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/optionalParamArgsTest.ts(101,1): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
@@ -20,10 +20,9 @@ tests/cases/compiler/optionalParamArgsTest.ts(114,1): error TS2346: Supplied par
|
||||
tests/cases/compiler/optionalParamArgsTest.ts(115,1): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/optionalParamArgsTest.ts(116,1): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/optionalParamArgsTest.ts(117,1): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/optionalParamArgsTest.ts(118,1): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
|
||||
|
||||
==== tests/cases/compiler/optionalParamArgsTest.ts (23 errors) ====
|
||||
==== tests/cases/compiler/optionalParamArgsTest.ts (22 errors) ====
|
||||
// Optional parameter and default argument tests
|
||||
|
||||
// Key:
|
||||
@@ -58,13 +57,10 @@ tests/cases/compiler/optionalParamArgsTest.ts(118,1): error TS2346: Supplied par
|
||||
~~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
|
||||
// Negative test
|
||||
// "Optional parameters may only be followed by other optional parameters"
|
||||
// Uninitialized parameter makes the initialized one required
|
||||
public C1M5(C1M5A1:number,C1M5A2:number=0,C1M5A3:number) { return C1M5A1 + C1M5A2; }
|
||||
~~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
~~~~~~
|
||||
!!! error TS1016: A required parameter cannot follow an optional parameter.
|
||||
}
|
||||
|
||||
class C2 extends C1 {
|
||||
|
||||
@@ -31,8 +31,7 @@ class C1 {
|
||||
|
||||
public C1M5(C1M5A1:number,C1M5A2:number=0,C1M5A3?:number) { return C1M5A1 + C1M5A2; }
|
||||
|
||||
// Negative test
|
||||
// "Optional parameters may only be followed by other optional parameters"
|
||||
// Uninitialized parameter makes the initialized one required
|
||||
public C1M5(C1M5A1:number,C1M5A2:number=0,C1M5A3:number) { return C1M5A1 + C1M5A2; }
|
||||
}
|
||||
|
||||
@@ -152,8 +151,7 @@ var C1 = (function () {
|
||||
if (C1M5A2 === void 0) { C1M5A2 = 0; }
|
||||
return C1M5A1 + C1M5A2;
|
||||
};
|
||||
// Negative test
|
||||
// "Optional parameters may only be followed by other optional parameters"
|
||||
// Uninitialized parameter makes the initialized one required
|
||||
C1.prototype.C1M5 = function (C1M5A1, C1M5A2, C1M5A3) {
|
||||
if (C1M5A2 === void 0) { C1M5A2 = 0; }
|
||||
return C1M5A1 + C1M5A2;
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
tests/cases/compiler/requiredInitializedParameter1.ts(11,1): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/requiredInitializedParameter1.ts(16,1): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
|
||||
|
||||
==== tests/cases/compiler/requiredInitializedParameter1.ts (2 errors) ====
|
||||
function f1(a, b = 0, c) { }
|
||||
function f2(a, b = 0, c = 0) { }
|
||||
function f3(a, b = 0, c?) { }
|
||||
function f4(a, b = 0, ...c) { }
|
||||
|
||||
f1(0, 1, 2);
|
||||
f2(0, 1, 2);
|
||||
f3(0, 1, 2);
|
||||
f4(0, 1, 2);
|
||||
|
||||
f1(0, 1);
|
||||
~~~~~~~~
|
||||
!!! error TS2346: Supplied parameters do not match any signature of call target.
|
||||
f2(0, 1);
|
||||
f3(0, 1);
|
||||
f4(0, 1);
|
||||
|
||||
f1(0);
|
||||
~~~~~
|
||||
!!! error TS2346: Supplied parameters do not match any signature of call target.
|
||||
f2(0);
|
||||
f3(0);
|
||||
f4(0);
|
||||
@@ -0,0 +1,51 @@
|
||||
//// [requiredInitializedParameter1.ts]
|
||||
function f1(a, b = 0, c) { }
|
||||
function f2(a, b = 0, c = 0) { }
|
||||
function f3(a, b = 0, c?) { }
|
||||
function f4(a, b = 0, ...c) { }
|
||||
|
||||
f1(0, 1, 2);
|
||||
f2(0, 1, 2);
|
||||
f3(0, 1, 2);
|
||||
f4(0, 1, 2);
|
||||
|
||||
f1(0, 1);
|
||||
f2(0, 1);
|
||||
f3(0, 1);
|
||||
f4(0, 1);
|
||||
|
||||
f1(0);
|
||||
f2(0);
|
||||
f3(0);
|
||||
f4(0);
|
||||
|
||||
//// [requiredInitializedParameter1.js]
|
||||
function f1(a, b, c) {
|
||||
if (b === void 0) { b = 0; }
|
||||
}
|
||||
function f2(a, b, c) {
|
||||
if (b === void 0) { b = 0; }
|
||||
if (c === void 0) { c = 0; }
|
||||
}
|
||||
function f3(a, b, c) {
|
||||
if (b === void 0) { b = 0; }
|
||||
}
|
||||
function f4(a, b) {
|
||||
if (b === void 0) { b = 0; }
|
||||
var c = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
c[_i - 2] = arguments[_i];
|
||||
}
|
||||
}
|
||||
f1(0, 1, 2);
|
||||
f2(0, 1, 2);
|
||||
f3(0, 1, 2);
|
||||
f4(0, 1, 2);
|
||||
f1(0, 1);
|
||||
f2(0, 1);
|
||||
f3(0, 1);
|
||||
f4(0, 1);
|
||||
f1(0);
|
||||
f2(0);
|
||||
f3(0);
|
||||
f4(0);
|
||||
@@ -0,0 +1,17 @@
|
||||
tests/cases/compiler/requiredInitializedParameter2.ts(5,7): error TS2420: Class 'C1' incorrectly implements interface 'I1'.
|
||||
Types of property 'method' are incompatible.
|
||||
Type '(a: number, b: any) => void' is not assignable to type '() => any'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/requiredInitializedParameter2.ts (1 errors) ====
|
||||
interface I1 {
|
||||
method();
|
||||
}
|
||||
|
||||
class C1 implements I1 {
|
||||
~~
|
||||
!!! error TS2420: Class 'C1' incorrectly implements interface 'I1'.
|
||||
!!! error TS2420: Types of property 'method' are incompatible.
|
||||
!!! error TS2420: Type '(a: number, b: any) => void' is not assignable to type '() => any'.
|
||||
method(a = 0, b) { }
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
//// [requiredInitializedParameter2.ts]
|
||||
interface I1 {
|
||||
method();
|
||||
}
|
||||
|
||||
class C1 implements I1 {
|
||||
method(a = 0, b) { }
|
||||
}
|
||||
|
||||
//// [requiredInitializedParameter2.js]
|
||||
var C1 = (function () {
|
||||
function C1() {
|
||||
}
|
||||
C1.prototype.method = function (a, b) {
|
||||
if (a === void 0) { a = 0; }
|
||||
};
|
||||
return C1;
|
||||
})();
|
||||
@@ -0,0 +1,27 @@
|
||||
//// [requiredInitializedParameter3.ts]
|
||||
interface I1 {
|
||||
method();
|
||||
}
|
||||
|
||||
class C1 implements I1 {
|
||||
method(a = 0, b?) { }
|
||||
}
|
||||
|
||||
//// [requiredInitializedParameter3.js]
|
||||
var C1 = (function () {
|
||||
function C1() {
|
||||
}
|
||||
C1.prototype.method = function (a, b) {
|
||||
if (a === void 0) { a = 0; }
|
||||
};
|
||||
return C1;
|
||||
})();
|
||||
|
||||
|
||||
//// [requiredInitializedParameter3.d.ts]
|
||||
interface I1 {
|
||||
method(): any;
|
||||
}
|
||||
declare class C1 implements I1 {
|
||||
method(a?: number, b?: any): void;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/compiler/requiredInitializedParameter3.ts ===
|
||||
interface I1 {
|
||||
>I1 : Symbol(I1, Decl(requiredInitializedParameter3.ts, 0, 0))
|
||||
|
||||
method();
|
||||
>method : Symbol(method, Decl(requiredInitializedParameter3.ts, 0, 14))
|
||||
}
|
||||
|
||||
class C1 implements I1 {
|
||||
>C1 : Symbol(C1, Decl(requiredInitializedParameter3.ts, 2, 1))
|
||||
>I1 : Symbol(I1, Decl(requiredInitializedParameter3.ts, 0, 0))
|
||||
|
||||
method(a = 0, b?) { }
|
||||
>method : Symbol(method, Decl(requiredInitializedParameter3.ts, 4, 24))
|
||||
>a : Symbol(a, Decl(requiredInitializedParameter3.ts, 5, 11))
|
||||
>b : Symbol(b, Decl(requiredInitializedParameter3.ts, 5, 17))
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/compiler/requiredInitializedParameter3.ts ===
|
||||
interface I1 {
|
||||
>I1 : I1
|
||||
|
||||
method();
|
||||
>method : () => any
|
||||
}
|
||||
|
||||
class C1 implements I1 {
|
||||
>C1 : C1
|
||||
>I1 : I1
|
||||
|
||||
method(a = 0, b?) { }
|
||||
>method : (a?: number, b?: any) => void
|
||||
>a : number
|
||||
>0 : number
|
||||
>b : any
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
//// [requiredInitializedParameter4.ts]
|
||||
class C1 {
|
||||
method(a = 0, b) { }
|
||||
}
|
||||
|
||||
//// [requiredInitializedParameter4.js]
|
||||
var C1 = (function () {
|
||||
function C1() {
|
||||
}
|
||||
C1.prototype.method = function (a, b) {
|
||||
if (a === void 0) { a = 0; }
|
||||
};
|
||||
return C1;
|
||||
})();
|
||||
|
||||
|
||||
//// [requiredInitializedParameter4.d.ts]
|
||||
declare class C1 {
|
||||
method(a: number, b: any): void;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
=== tests/cases/compiler/requiredInitializedParameter4.ts ===
|
||||
class C1 {
|
||||
>C1 : Symbol(C1, Decl(requiredInitializedParameter4.ts, 0, 0))
|
||||
|
||||
method(a = 0, b) { }
|
||||
>method : Symbol(method, Decl(requiredInitializedParameter4.ts, 0, 10))
|
||||
>a : Symbol(a, Decl(requiredInitializedParameter4.ts, 1, 11))
|
||||
>b : Symbol(b, Decl(requiredInitializedParameter4.ts, 1, 17))
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
=== tests/cases/compiler/requiredInitializedParameter4.ts ===
|
||||
class C1 {
|
||||
>C1 : C1
|
||||
|
||||
method(a = 0, b) { }
|
||||
>method : (a: number, b: any) => void
|
||||
>a : number
|
||||
>0 : number
|
||||
>b : any
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
//// [resolveInterfaceNameWithSameLetDeclarationName1.ts]
|
||||
interface bar { }
|
||||
let bar: bar;
|
||||
|
||||
|
||||
//// [resolveInterfaceNameWithSameLetDeclarationName1.js]
|
||||
var bar;
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/compiler/resolveInterfaceNameWithSameLetDeclarationName1.ts ===
|
||||
interface bar { }
|
||||
>bar : Symbol(bar, Decl(resolveInterfaceNameWithSameLetDeclarationName1.ts, 0, 0), Decl(resolveInterfaceNameWithSameLetDeclarationName1.ts, 1, 3))
|
||||
|
||||
let bar: bar;
|
||||
>bar : Symbol(bar, Decl(resolveInterfaceNameWithSameLetDeclarationName1.ts, 0, 0), Decl(resolveInterfaceNameWithSameLetDeclarationName1.ts, 1, 3))
|
||||
>bar : Symbol(bar, Decl(resolveInterfaceNameWithSameLetDeclarationName1.ts, 0, 0), Decl(resolveInterfaceNameWithSameLetDeclarationName1.ts, 1, 3))
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/compiler/resolveInterfaceNameWithSameLetDeclarationName1.ts ===
|
||||
interface bar { }
|
||||
>bar : bar
|
||||
|
||||
let bar: bar;
|
||||
>bar : bar
|
||||
>bar : bar
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
//// [resolveInterfaceNameWithSameLetDeclarationName2.ts]
|
||||
interface foo { }
|
||||
interface bar { }
|
||||
let bar: bar | foo;
|
||||
let foo: bar | foo;
|
||||
|
||||
//// [resolveInterfaceNameWithSameLetDeclarationName2.js]
|
||||
var bar;
|
||||
var foo;
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/compiler/resolveInterfaceNameWithSameLetDeclarationName2.ts ===
|
||||
interface foo { }
|
||||
>foo : Symbol(foo, Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 0, 0), Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 3, 3))
|
||||
|
||||
interface bar { }
|
||||
>bar : Symbol(bar, Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 0, 17), Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 2, 3))
|
||||
|
||||
let bar: bar | foo;
|
||||
>bar : Symbol(bar, Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 0, 17), Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 2, 3))
|
||||
>bar : Symbol(bar, Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 0, 17), Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 2, 3))
|
||||
>foo : Symbol(foo, Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 0, 0), Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 3, 3))
|
||||
|
||||
let foo: bar | foo;
|
||||
>foo : Symbol(foo, Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 0, 0), Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 3, 3))
|
||||
>bar : Symbol(bar, Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 0, 17), Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 2, 3))
|
||||
>foo : Symbol(foo, Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 0, 0), Decl(resolveInterfaceNameWithSameLetDeclarationName2.ts, 3, 3))
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/compiler/resolveInterfaceNameWithSameLetDeclarationName2.ts ===
|
||||
interface foo { }
|
||||
>foo : foo
|
||||
|
||||
interface bar { }
|
||||
>bar : bar
|
||||
|
||||
let bar: bar | foo;
|
||||
>bar : bar | foo
|
||||
>bar : bar
|
||||
>foo : foo
|
||||
|
||||
let foo: bar | foo;
|
||||
>foo : bar | foo
|
||||
>bar : bar
|
||||
>foo : foo
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//// [resolveModuleNameWithSameLetDeclarationName1.ts]
|
||||
declare module foo {
|
||||
|
||||
interface Bar {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
let foo: foo.Bar;
|
||||
|
||||
//// [resolveModuleNameWithSameLetDeclarationName1.js]
|
||||
var foo;
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/compiler/resolveModuleNameWithSameLetDeclarationName1.ts ===
|
||||
declare module foo {
|
||||
>foo : Symbol(foo, Decl(resolveModuleNameWithSameLetDeclarationName1.ts, 0, 0), Decl(resolveModuleNameWithSameLetDeclarationName1.ts, 7, 3))
|
||||
|
||||
interface Bar {
|
||||
>Bar : Symbol(Bar, Decl(resolveModuleNameWithSameLetDeclarationName1.ts, 0, 20))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
let foo: foo.Bar;
|
||||
>foo : Symbol(foo, Decl(resolveModuleNameWithSameLetDeclarationName1.ts, 0, 0), Decl(resolveModuleNameWithSameLetDeclarationName1.ts, 7, 3))
|
||||
>foo : Symbol(foo, Decl(resolveModuleNameWithSameLetDeclarationName1.ts, 0, 0), Decl(resolveModuleNameWithSameLetDeclarationName1.ts, 7, 3))
|
||||
>Bar : Symbol(foo.Bar, Decl(resolveModuleNameWithSameLetDeclarationName1.ts, 0, 20))
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/compiler/resolveModuleNameWithSameLetDeclarationName1.ts ===
|
||||
declare module foo {
|
||||
>foo : Bar
|
||||
|
||||
interface Bar {
|
||||
>Bar : Bar
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
let foo: foo.Bar;
|
||||
>foo : foo.Bar
|
||||
>foo : any
|
||||
>Bar : foo.Bar
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
//// [resolveModuleNameWithSameLetDeclarationName2.ts]
|
||||
declare module "punycode" {
|
||||
interface ucs2 {
|
||||
decode(string: string): string;
|
||||
encode(codePoints: number[]): string;
|
||||
}
|
||||
|
||||
export let ucs2: ucs2;
|
||||
}
|
||||
|
||||
//// [resolveModuleNameWithSameLetDeclarationName2.js]
|
||||
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/compiler/resolveModuleNameWithSameLetDeclarationName2.ts ===
|
||||
declare module "punycode" {
|
||||
interface ucs2 {
|
||||
>ucs2 : Symbol(ucs2, Decl(resolveModuleNameWithSameLetDeclarationName2.ts, 0, 27), Decl(resolveModuleNameWithSameLetDeclarationName2.ts, 6, 14))
|
||||
|
||||
decode(string: string): string;
|
||||
>decode : Symbol(decode, Decl(resolveModuleNameWithSameLetDeclarationName2.ts, 1, 20))
|
||||
>string : Symbol(string, Decl(resolveModuleNameWithSameLetDeclarationName2.ts, 2, 15))
|
||||
|
||||
encode(codePoints: number[]): string;
|
||||
>encode : Symbol(encode, Decl(resolveModuleNameWithSameLetDeclarationName2.ts, 2, 39))
|
||||
>codePoints : Symbol(codePoints, Decl(resolveModuleNameWithSameLetDeclarationName2.ts, 3, 15))
|
||||
}
|
||||
|
||||
export let ucs2: ucs2;
|
||||
>ucs2 : Symbol(ucs2, Decl(resolveModuleNameWithSameLetDeclarationName2.ts, 0, 27), Decl(resolveModuleNameWithSameLetDeclarationName2.ts, 6, 14))
|
||||
>ucs2 : Symbol(ucs2, Decl(resolveModuleNameWithSameLetDeclarationName2.ts, 0, 27), Decl(resolveModuleNameWithSameLetDeclarationName2.ts, 6, 14))
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/compiler/resolveModuleNameWithSameLetDeclarationName2.ts ===
|
||||
declare module "punycode" {
|
||||
interface ucs2 {
|
||||
>ucs2 : ucs2
|
||||
|
||||
decode(string: string): string;
|
||||
>decode : (string: string) => string
|
||||
>string : string
|
||||
|
||||
encode(codePoints: number[]): string;
|
||||
>encode : (codePoints: number[]) => string
|
||||
>codePoints : number[]
|
||||
}
|
||||
|
||||
export let ucs2: ucs2;
|
||||
>ucs2 : ucs2
|
||||
>ucs2 : ucs2
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [resolveTypeAliasWithSameLetDeclarationName1.ts]
|
||||
class C { }
|
||||
type baz = C;
|
||||
let baz: baz;
|
||||
|
||||
|
||||
//// [resolveTypeAliasWithSameLetDeclarationName1.js]
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
var baz;
|
||||
@@ -0,0 +1,12 @@
|
||||
=== tests/cases/compiler/resolveTypeAliasWithSameLetDeclarationName1.ts ===
|
||||
class C { }
|
||||
>C : Symbol(C, Decl(resolveTypeAliasWithSameLetDeclarationName1.ts, 0, 0))
|
||||
|
||||
type baz = C;
|
||||
>baz : Symbol(baz, Decl(resolveTypeAliasWithSameLetDeclarationName1.ts, 0, 11), Decl(resolveTypeAliasWithSameLetDeclarationName1.ts, 2, 3))
|
||||
>C : Symbol(C, Decl(resolveTypeAliasWithSameLetDeclarationName1.ts, 0, 0))
|
||||
|
||||
let baz: baz;
|
||||
>baz : Symbol(baz, Decl(resolveTypeAliasWithSameLetDeclarationName1.ts, 0, 11), Decl(resolveTypeAliasWithSameLetDeclarationName1.ts, 2, 3))
|
||||
>baz : Symbol(baz, Decl(resolveTypeAliasWithSameLetDeclarationName1.ts, 0, 11), Decl(resolveTypeAliasWithSameLetDeclarationName1.ts, 2, 3))
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
=== tests/cases/compiler/resolveTypeAliasWithSameLetDeclarationName1.ts ===
|
||||
class C { }
|
||||
>C : C
|
||||
|
||||
type baz = C;
|
||||
>baz : C
|
||||
>C : C
|
||||
|
||||
let baz: baz;
|
||||
>baz : C
|
||||
>baz : C
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
tests/cases/conformance/jsx/tsxElementResolution8.tsx(8,2): error TS2604: JSX element type 'Div' does not have any construct or call signatures.
|
||||
tests/cases/conformance/jsx/tsxElementResolution8.tsx(16,2): error TS2601: The return type of a JSX element constructor must return an object type.
|
||||
tests/cases/conformance/jsx/tsxElementResolution8.tsx(29,2): error TS2601: The return type of a JSX element constructor must return an object type.
|
||||
tests/cases/conformance/jsx/tsxElementResolution8.tsx(34,2): error TS2604: JSX element type 'Obj3' does not have any construct or call signatures.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/tsxElementResolution8.tsx (4 errors) ====
|
||||
==== tests/cases/conformance/jsx/tsxElementResolution8.tsx (2 errors) ====
|
||||
declare module JSX {
|
||||
interface Element { }
|
||||
interface IntrinsicElements { }
|
||||
@@ -23,8 +21,6 @@ tests/cases/conformance/jsx/tsxElementResolution8.tsx(34,2): error TS2604: JSX e
|
||||
// Error
|
||||
function Fnum(): number{ return 42; }
|
||||
<Fnum />
|
||||
~~~~
|
||||
!!! error TS2601: The return type of a JSX element constructor must return an object type.
|
||||
|
||||
interface Obj1 {
|
||||
new(): {};
|
||||
@@ -38,8 +34,6 @@ tests/cases/conformance/jsx/tsxElementResolution8.tsx(34,2): error TS2604: JSX e
|
||||
}
|
||||
var Obj2: Obj2;
|
||||
<Obj2 />; // Error
|
||||
~~~~
|
||||
!!! error TS2601: The return type of a JSX element constructor must return an object type.
|
||||
|
||||
interface Obj3 {
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
tests/cases/conformance/jsx/tsxElementResolution9.tsx(11,2): error TS2601: The return type of a JSX element constructor must return an object type.
|
||||
tests/cases/conformance/jsx/tsxElementResolution9.tsx(18,2): error TS2601: The return type of a JSX element constructor must return an object type.
|
||||
tests/cases/conformance/jsx/tsxElementResolution9.tsx(25,2): error TS2601: The return type of a JSX element constructor must return an object type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/tsxElementResolution9.tsx (3 errors) ====
|
||||
declare module JSX {
|
||||
interface Element { }
|
||||
interface IntrinsicElements { }
|
||||
}
|
||||
|
||||
interface Obj1 {
|
||||
new(n: string): { x: number };
|
||||
new(n: number): { y: string };
|
||||
}
|
||||
var Obj1: Obj1;
|
||||
<Obj1 />; // Error, return type is not an object type
|
||||
~~~~
|
||||
!!! error TS2601: The return type of a JSX element constructor must return an object type.
|
||||
|
||||
interface Obj2 {
|
||||
(n: string): { x: number };
|
||||
(n: number): { y: string };
|
||||
}
|
||||
var Obj2: Obj2;
|
||||
<Obj2 />; // Error, return type is not an object type
|
||||
~~~~
|
||||
!!! error TS2601: The return type of a JSX element constructor must return an object type.
|
||||
|
||||
interface Obj3 {
|
||||
(n: string): { x: number };
|
||||
(n: number): { x: number; y: string };
|
||||
}
|
||||
var Obj3: Obj3;
|
||||
<Obj3 x={42} />; // OK
|
||||
~~~~
|
||||
!!! error TS2601: The return type of a JSX element constructor must return an object type.
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
=== tests/cases/conformance/jsx/tsxElementResolution9.tsx ===
|
||||
declare module JSX {
|
||||
>JSX : Symbol(JSX, Decl(tsxElementResolution9.tsx, 0, 0))
|
||||
|
||||
interface Element { }
|
||||
>Element : Symbol(Element, Decl(tsxElementResolution9.tsx, 0, 20))
|
||||
|
||||
interface IntrinsicElements { }
|
||||
>IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxElementResolution9.tsx, 1, 22))
|
||||
}
|
||||
|
||||
interface Obj1 {
|
||||
>Obj1 : Symbol(Obj1, Decl(tsxElementResolution9.tsx, 3, 1), Decl(tsxElementResolution9.tsx, 9, 3))
|
||||
|
||||
new(n: string): { x: number };
|
||||
>n : Symbol(n, Decl(tsxElementResolution9.tsx, 6, 5))
|
||||
>x : Symbol(x, Decl(tsxElementResolution9.tsx, 6, 18))
|
||||
|
||||
new(n: number): { y: string };
|
||||
>n : Symbol(n, Decl(tsxElementResolution9.tsx, 7, 5))
|
||||
>y : Symbol(y, Decl(tsxElementResolution9.tsx, 7, 18))
|
||||
}
|
||||
var Obj1: Obj1;
|
||||
>Obj1 : Symbol(Obj1, Decl(tsxElementResolution9.tsx, 3, 1), Decl(tsxElementResolution9.tsx, 9, 3))
|
||||
>Obj1 : Symbol(Obj1, Decl(tsxElementResolution9.tsx, 3, 1), Decl(tsxElementResolution9.tsx, 9, 3))
|
||||
|
||||
<Obj1 />; // Error, return type is not an object type
|
||||
>Obj1 : Symbol(Obj1, Decl(tsxElementResolution9.tsx, 3, 1), Decl(tsxElementResolution9.tsx, 9, 3))
|
||||
|
||||
interface Obj2 {
|
||||
>Obj2 : Symbol(Obj2, Decl(tsxElementResolution9.tsx, 10, 9), Decl(tsxElementResolution9.tsx, 16, 3))
|
||||
|
||||
(n: string): { x: number };
|
||||
>n : Symbol(n, Decl(tsxElementResolution9.tsx, 13, 2))
|
||||
>x : Symbol(x, Decl(tsxElementResolution9.tsx, 13, 15))
|
||||
|
||||
(n: number): { y: string };
|
||||
>n : Symbol(n, Decl(tsxElementResolution9.tsx, 14, 2))
|
||||
>y : Symbol(y, Decl(tsxElementResolution9.tsx, 14, 15))
|
||||
}
|
||||
var Obj2: Obj2;
|
||||
>Obj2 : Symbol(Obj2, Decl(tsxElementResolution9.tsx, 10, 9), Decl(tsxElementResolution9.tsx, 16, 3))
|
||||
>Obj2 : Symbol(Obj2, Decl(tsxElementResolution9.tsx, 10, 9), Decl(tsxElementResolution9.tsx, 16, 3))
|
||||
|
||||
<Obj2 />; // Error, return type is not an object type
|
||||
>Obj2 : Symbol(Obj2, Decl(tsxElementResolution9.tsx, 10, 9), Decl(tsxElementResolution9.tsx, 16, 3))
|
||||
|
||||
interface Obj3 {
|
||||
>Obj3 : Symbol(Obj3, Decl(tsxElementResolution9.tsx, 17, 9), Decl(tsxElementResolution9.tsx, 23, 3))
|
||||
|
||||
(n: string): { x: number };
|
||||
>n : Symbol(n, Decl(tsxElementResolution9.tsx, 20, 2))
|
||||
>x : Symbol(x, Decl(tsxElementResolution9.tsx, 20, 15))
|
||||
|
||||
(n: number): { x: number; y: string };
|
||||
>n : Symbol(n, Decl(tsxElementResolution9.tsx, 21, 2))
|
||||
>x : Symbol(x, Decl(tsxElementResolution9.tsx, 21, 15))
|
||||
>y : Symbol(y, Decl(tsxElementResolution9.tsx, 21, 26))
|
||||
}
|
||||
var Obj3: Obj3;
|
||||
>Obj3 : Symbol(Obj3, Decl(tsxElementResolution9.tsx, 17, 9), Decl(tsxElementResolution9.tsx, 23, 3))
|
||||
>Obj3 : Symbol(Obj3, Decl(tsxElementResolution9.tsx, 17, 9), Decl(tsxElementResolution9.tsx, 23, 3))
|
||||
|
||||
<Obj3 x={42} />; // OK
|
||||
>Obj3 : Symbol(Obj3, Decl(tsxElementResolution9.tsx, 17, 9), Decl(tsxElementResolution9.tsx, 23, 3))
|
||||
>x : Symbol(unknown)
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
=== tests/cases/conformance/jsx/tsxElementResolution9.tsx ===
|
||||
declare module JSX {
|
||||
>JSX : any
|
||||
|
||||
interface Element { }
|
||||
>Element : Element
|
||||
|
||||
interface IntrinsicElements { }
|
||||
>IntrinsicElements : IntrinsicElements
|
||||
}
|
||||
|
||||
interface Obj1 {
|
||||
>Obj1 : Obj1
|
||||
|
||||
new(n: string): { x: number };
|
||||
>n : string
|
||||
>x : number
|
||||
|
||||
new(n: number): { y: string };
|
||||
>n : number
|
||||
>y : string
|
||||
}
|
||||
var Obj1: Obj1;
|
||||
>Obj1 : Obj1
|
||||
>Obj1 : Obj1
|
||||
|
||||
<Obj1 />; // Error, return type is not an object type
|
||||
><Obj1 /> : JSX.Element
|
||||
>Obj1 : Obj1
|
||||
|
||||
interface Obj2 {
|
||||
>Obj2 : Obj2
|
||||
|
||||
(n: string): { x: number };
|
||||
>n : string
|
||||
>x : number
|
||||
|
||||
(n: number): { y: string };
|
||||
>n : number
|
||||
>y : string
|
||||
}
|
||||
var Obj2: Obj2;
|
||||
>Obj2 : Obj2
|
||||
>Obj2 : Obj2
|
||||
|
||||
<Obj2 />; // Error, return type is not an object type
|
||||
><Obj2 /> : JSX.Element
|
||||
>Obj2 : Obj2
|
||||
|
||||
interface Obj3 {
|
||||
>Obj3 : Obj3
|
||||
|
||||
(n: string): { x: number };
|
||||
>n : string
|
||||
>x : number
|
||||
|
||||
(n: number): { x: number; y: string };
|
||||
>n : number
|
||||
>x : number
|
||||
>y : string
|
||||
}
|
||||
var Obj3: Obj3;
|
||||
>Obj3 : Obj3
|
||||
>Obj3 : Obj3
|
||||
|
||||
<Obj3 x={42} />; // OK
|
||||
><Obj3 x={42} /> : JSX.Element
|
||||
>Obj3 : Obj3
|
||||
>x : any
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [tsxEmit3.tsx]
|
||||
|
||||
declare module JSX {
|
||||
interface Element { }
|
||||
interface IntrinsicElements { }
|
||||
@@ -82,3 +83,4 @@ var M;
|
||||
// Emit M_1.Foo
|
||||
M_1.Foo, <M_1.Foo />;
|
||||
})(M || (M = {}));
|
||||
//# sourceMappingURL=tsxEmit3.jsx.map
|
||||
@@ -0,0 +1,2 @@
|
||||
//// [tsxEmit3.jsx.map]
|
||||
{"version":3,"file":"tsxEmit3.jsx","sourceRoot":"","sources":["tsxEmit3.tsx"],"names":["M","M.Foo","M.Foo.constructor","M.S","M.S.Bar","M.S.Bar.constructor"],"mappings":"AAMA,IAAO,CAAC,CAQP;AARD,WAAO,CAAC,EAAC,CAAC;IACTA;QAAmBC;QAAgBC,CAACA;QAACD,UAACA;IAADA,CAACA,AAAtCD,IAAsCA;IAAzBA,KAAGA,MAAsBA,CAAAA;IACtCA,IAAcA,CAACA,CAKdA;IALDA,WAAcA,CAACA,EAACA,CAACA;QAChBG;YAAAC;YAAmBC,CAACA;YAADD,UAACA;QAADA,CAACA,AAApBD,IAAoBA;QAAPA,KAAGA,MAAIA,CAAAA;IAIrBA,CAACA,EALaH,CAACA,GAADA,GAACA,KAADA,GAACA,QAKdA;AACFA,CAACA,EARM,CAAC,KAAD,CAAC,QAQP;AAED,IAAO,CAAC,CAYP;AAZD,WAAO,CAAC,EAAC,CAAC;IAETA,AADAA,aAAaA;IACbA,KAAGA,EAAEA,CAACA,KAAGA,GAAGA,CAACA;IAEbA,IAAcA,CAACA,CAMdA;IANDA,WAAcA,CAACA,EAACA,CAACA;QAEhBG,AADAA,aAAaA;QACbA,KAAGA,EAAEA,CAACA,KAAGA,GAAGA,CAACA;QAGbA,AADAA,aAAaA;QACbA,KAAGA,EAAEA,CAACA,KAAGA,GAAGA,CAACA;IACdA,CAACA,EANaH,CAACA,GAADA,GAACA,KAADA,GAACA,QAMdA;AAEFA,CAACA,EAZM,CAAC,KAAD,CAAC,QAYP;AAED,IAAO,CAAC,CAGP;AAHD,WAAO,CAAC,EAAC,CAAC;IAETA,AADAA,eAAeA;IACfA,GAACA,CAACA,GAAGA,EAAEA,CAACA,GAACA,CAACA,GAAGA,GAAGA,CAACA;AAClBA,CAACA,EAHM,CAAC,KAAD,CAAC,QAGP;AAED,IAAO,CAAC,CAIP;AAJD,WAAO,GAAC,EAAC,CAAC;IACTA,IAAIA,CAACA,GAAGA,GAAGA,CAACA;IAEZA,AADAA,eAAeA;IACfA,OAAGA,EAAEA,CAACA,OAAGA,GAAGA,CAACA;AACdA,CAACA,EAJM,CAAC,KAAD,CAAC,QAIP"}
|
||||
@@ -0,0 +1,805 @@
|
||||
===================================================================
|
||||
JsFile: tsxEmit3.jsx
|
||||
mapUrl: tsxEmit3.jsx.map
|
||||
sourceRoot:
|
||||
sources: tsxEmit3.tsx
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:tests/cases/conformance/jsx/tsxEmit3.jsx
|
||||
sourceFile:tsxEmit3.tsx
|
||||
-------------------------------------------------------------------
|
||||
>>>var M;
|
||||
1 >
|
||||
2 >^^^^
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^->
|
||||
1 >
|
||||
>declare module JSX {
|
||||
> interface Element { }
|
||||
> interface IntrinsicElements { }
|
||||
>}
|
||||
>
|
||||
>
|
||||
2 >module
|
||||
3 > M
|
||||
4 > {
|
||||
> export class Foo { constructor() { } }
|
||||
> export module S {
|
||||
> export class Bar { }
|
||||
>
|
||||
> // Emit Foo
|
||||
> // Foo, <Foo />;
|
||||
> }
|
||||
> }
|
||||
1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0)
|
||||
2 >Emitted(1, 5) Source(7, 8) + SourceIndex(0)
|
||||
3 >Emitted(1, 6) Source(7, 9) + SourceIndex(0)
|
||||
4 >Emitted(1, 7) Source(15, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>(function (M) {
|
||||
1->
|
||||
2 >^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
6 > ^^^^^^^^^^^^^^->
|
||||
1->
|
||||
2 >module
|
||||
3 > M
|
||||
4 >
|
||||
5 > {
|
||||
1->Emitted(2, 1) Source(7, 1) + SourceIndex(0)
|
||||
2 >Emitted(2, 12) Source(7, 8) + SourceIndex(0)
|
||||
3 >Emitted(2, 13) Source(7, 9) + SourceIndex(0)
|
||||
4 >Emitted(2, 15) Source(7, 10) + SourceIndex(0)
|
||||
5 >Emitted(2, 16) Source(7, 11) + SourceIndex(0)
|
||||
---
|
||||
>>> var Foo = (function () {
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->
|
||||
>
|
||||
1->Emitted(3, 5) Source(8, 2) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>> function Foo() {
|
||||
1->^^^^^^^^
|
||||
2 > ^^->
|
||||
1->export class Foo {
|
||||
1->Emitted(4, 9) Source(8, 21) + SourceIndex(0) name (M.Foo)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^^^->
|
||||
1->constructor() {
|
||||
2 > }
|
||||
1->Emitted(5, 9) Source(8, 37) + SourceIndex(0) name (M.Foo.constructor)
|
||||
2 >Emitted(5, 10) Source(8, 38) + SourceIndex(0) name (M.Foo.constructor)
|
||||
---
|
||||
>>> return Foo;
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^^^^^^
|
||||
1->
|
||||
2 > }
|
||||
1->Emitted(6, 9) Source(8, 39) + SourceIndex(0) name (M.Foo)
|
||||
2 >Emitted(6, 19) Source(8, 40) + SourceIndex(0) name (M.Foo)
|
||||
---
|
||||
>>> })();
|
||||
1 >^^^^
|
||||
2 > ^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^->
|
||||
1 >
|
||||
2 > }
|
||||
3 >
|
||||
4 > export class Foo { constructor() { } }
|
||||
1 >Emitted(7, 5) Source(8, 39) + SourceIndex(0) name (M.Foo)
|
||||
2 >Emitted(7, 6) Source(8, 40) + SourceIndex(0) name (M.Foo)
|
||||
3 >Emitted(7, 6) Source(8, 2) + SourceIndex(0) name (M)
|
||||
4 >Emitted(7, 10) Source(8, 40) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>> M.Foo = Foo;
|
||||
1->^^^^
|
||||
2 > ^^^^^
|
||||
3 > ^^^^^^
|
||||
4 > ^
|
||||
1->
|
||||
2 > Foo
|
||||
3 > { constructor() { } }
|
||||
4 >
|
||||
1->Emitted(8, 5) Source(8, 15) + SourceIndex(0) name (M)
|
||||
2 >Emitted(8, 10) Source(8, 18) + SourceIndex(0) name (M)
|
||||
3 >Emitted(8, 16) Source(8, 40) + SourceIndex(0) name (M)
|
||||
4 >Emitted(8, 17) Source(8, 40) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>> var S;
|
||||
1 >^^^^
|
||||
2 > ^^^^
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
2 > export module
|
||||
3 > S
|
||||
4 > {
|
||||
> export class Bar { }
|
||||
>
|
||||
> // Emit Foo
|
||||
> // Foo, <Foo />;
|
||||
> }
|
||||
1 >Emitted(9, 5) Source(9, 2) + SourceIndex(0) name (M)
|
||||
2 >Emitted(9, 9) Source(9, 16) + SourceIndex(0) name (M)
|
||||
3 >Emitted(9, 10) Source(9, 17) + SourceIndex(0) name (M)
|
||||
4 >Emitted(9, 11) Source(14, 3) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>> (function (S) {
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
6 > ^^^^^^^^^^^^^^->
|
||||
1->
|
||||
2 > export module
|
||||
3 > S
|
||||
4 >
|
||||
5 > {
|
||||
1->Emitted(10, 5) Source(9, 2) + SourceIndex(0) name (M)
|
||||
2 >Emitted(10, 16) Source(9, 16) + SourceIndex(0) name (M)
|
||||
3 >Emitted(10, 17) Source(9, 17) + SourceIndex(0) name (M)
|
||||
4 >Emitted(10, 19) Source(9, 18) + SourceIndex(0) name (M)
|
||||
5 >Emitted(10, 20) Source(9, 19) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>> var Bar = (function () {
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->
|
||||
>
|
||||
1->Emitted(11, 9) Source(10, 3) + SourceIndex(0) name (M.S)
|
||||
---
|
||||
>>> function Bar() {
|
||||
1->^^^^^^^^^^^^
|
||||
2 > ^^->
|
||||
1->
|
||||
1->Emitted(12, 13) Source(10, 3) + SourceIndex(0) name (M.S.Bar)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^^^^^^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^^^->
|
||||
1->export class Bar {
|
||||
2 > }
|
||||
1->Emitted(13, 13) Source(10, 22) + SourceIndex(0) name (M.S.Bar.constructor)
|
||||
2 >Emitted(13, 14) Source(10, 23) + SourceIndex(0) name (M.S.Bar.constructor)
|
||||
---
|
||||
>>> return Bar;
|
||||
1->^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^
|
||||
1->
|
||||
2 > }
|
||||
1->Emitted(14, 13) Source(10, 22) + SourceIndex(0) name (M.S.Bar)
|
||||
2 >Emitted(14, 23) Source(10, 23) + SourceIndex(0) name (M.S.Bar)
|
||||
---
|
||||
>>> })();
|
||||
1 >^^^^^^^^
|
||||
2 > ^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^->
|
||||
1 >
|
||||
2 > }
|
||||
3 >
|
||||
4 > export class Bar { }
|
||||
1 >Emitted(15, 9) Source(10, 22) + SourceIndex(0) name (M.S.Bar)
|
||||
2 >Emitted(15, 10) Source(10, 23) + SourceIndex(0) name (M.S.Bar)
|
||||
3 >Emitted(15, 10) Source(10, 3) + SourceIndex(0) name (M.S)
|
||||
4 >Emitted(15, 14) Source(10, 23) + SourceIndex(0) name (M.S)
|
||||
---
|
||||
>>> S.Bar = Bar;
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^
|
||||
3 > ^^^^^^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^^->
|
||||
1->
|
||||
2 > Bar
|
||||
3 > { }
|
||||
4 >
|
||||
1->Emitted(16, 9) Source(10, 16) + SourceIndex(0) name (M.S)
|
||||
2 >Emitted(16, 14) Source(10, 19) + SourceIndex(0) name (M.S)
|
||||
3 >Emitted(16, 20) Source(10, 23) + SourceIndex(0) name (M.S)
|
||||
4 >Emitted(16, 21) Source(10, 23) + SourceIndex(0) name (M.S)
|
||||
---
|
||||
>>> })(S = M.S || (M.S = {}));
|
||||
1->^^^^
|
||||
2 > ^
|
||||
3 > ^^
|
||||
4 > ^
|
||||
5 > ^^^
|
||||
6 > ^^^
|
||||
7 > ^^^^^
|
||||
8 > ^^^
|
||||
9 > ^^^^^^^^
|
||||
1->
|
||||
>
|
||||
> // Emit Foo
|
||||
> // Foo, <Foo />;
|
||||
>
|
||||
2 > }
|
||||
3 >
|
||||
4 > S
|
||||
5 >
|
||||
6 > S
|
||||
7 >
|
||||
8 > S
|
||||
9 > {
|
||||
> export class Bar { }
|
||||
>
|
||||
> // Emit Foo
|
||||
> // Foo, <Foo />;
|
||||
> }
|
||||
1->Emitted(17, 5) Source(14, 2) + SourceIndex(0) name (M.S)
|
||||
2 >Emitted(17, 6) Source(14, 3) + SourceIndex(0) name (M.S)
|
||||
3 >Emitted(17, 8) Source(9, 16) + SourceIndex(0) name (M)
|
||||
4 >Emitted(17, 9) Source(9, 17) + SourceIndex(0) name (M)
|
||||
5 >Emitted(17, 12) Source(9, 16) + SourceIndex(0) name (M)
|
||||
6 >Emitted(17, 15) Source(9, 17) + SourceIndex(0) name (M)
|
||||
7 >Emitted(17, 20) Source(9, 16) + SourceIndex(0) name (M)
|
||||
8 >Emitted(17, 23) Source(9, 17) + SourceIndex(0) name (M)
|
||||
9 >Emitted(17, 31) Source(14, 3) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>>})(M || (M = {}));
|
||||
1 >
|
||||
2 >^
|
||||
3 > ^^
|
||||
4 > ^
|
||||
5 > ^^^^^
|
||||
6 > ^
|
||||
7 > ^^^^^^^^
|
||||
1 >
|
||||
>
|
||||
2 >}
|
||||
3 >
|
||||
4 > M
|
||||
5 >
|
||||
6 > M
|
||||
7 > {
|
||||
> export class Foo { constructor() { } }
|
||||
> export module S {
|
||||
> export class Bar { }
|
||||
>
|
||||
> // Emit Foo
|
||||
> // Foo, <Foo />;
|
||||
> }
|
||||
> }
|
||||
1 >Emitted(18, 1) Source(15, 1) + SourceIndex(0) name (M)
|
||||
2 >Emitted(18, 2) Source(15, 2) + SourceIndex(0) name (M)
|
||||
3 >Emitted(18, 4) Source(7, 8) + SourceIndex(0)
|
||||
4 >Emitted(18, 5) Source(7, 9) + SourceIndex(0)
|
||||
5 >Emitted(18, 10) Source(7, 8) + SourceIndex(0)
|
||||
6 >Emitted(18, 11) Source(7, 9) + SourceIndex(0)
|
||||
7 >Emitted(18, 19) Source(15, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>var M;
|
||||
1 >
|
||||
2 >^^^^
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
>
|
||||
2 >module
|
||||
3 > M
|
||||
4 > {
|
||||
> // Emit M.Foo
|
||||
> Foo, <Foo />;
|
||||
>
|
||||
> export module S {
|
||||
> // Emit M.Foo
|
||||
> Foo, <Foo />;
|
||||
>
|
||||
> // Emit S.Bar
|
||||
> Bar, <Bar />;
|
||||
> }
|
||||
>
|
||||
> }
|
||||
1 >Emitted(19, 1) Source(17, 1) + SourceIndex(0)
|
||||
2 >Emitted(19, 5) Source(17, 8) + SourceIndex(0)
|
||||
3 >Emitted(19, 6) Source(17, 9) + SourceIndex(0)
|
||||
4 >Emitted(19, 7) Source(29, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>(function (M) {
|
||||
1->
|
||||
2 >^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
6 > ^^^->
|
||||
1->
|
||||
2 >module
|
||||
3 > M
|
||||
4 >
|
||||
5 > {
|
||||
1->Emitted(20, 1) Source(17, 1) + SourceIndex(0)
|
||||
2 >Emitted(20, 12) Source(17, 8) + SourceIndex(0)
|
||||
3 >Emitted(20, 13) Source(17, 9) + SourceIndex(0)
|
||||
4 >Emitted(20, 15) Source(17, 10) + SourceIndex(0)
|
||||
5 >Emitted(20, 16) Source(17, 11) + SourceIndex(0)
|
||||
---
|
||||
>>> // Emit M.Foo
|
||||
1->^^^^
|
||||
2 >
|
||||
3 > ^^^^^^^^^^^^^
|
||||
4 > ^^^^^->
|
||||
1->
|
||||
> // Emit M.Foo
|
||||
>
|
||||
2 >
|
||||
3 > // Emit M.Foo
|
||||
1->Emitted(21, 5) Source(19, 2) + SourceIndex(0) name (M)
|
||||
2 >Emitted(21, 5) Source(18, 2) + SourceIndex(0) name (M)
|
||||
3 >Emitted(21, 18) Source(18, 15) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>> M.Foo, <M.Foo />;
|
||||
1->^^^^
|
||||
2 > ^^^^^
|
||||
3 > ^^
|
||||
4 > ^
|
||||
5 > ^^^^^
|
||||
6 > ^^^
|
||||
7 > ^
|
||||
1->
|
||||
>
|
||||
2 > Foo
|
||||
3 > ,
|
||||
4 > <
|
||||
5 > Foo
|
||||
6 > />
|
||||
7 > ;
|
||||
1->Emitted(22, 5) Source(19, 2) + SourceIndex(0) name (M)
|
||||
2 >Emitted(22, 10) Source(19, 5) + SourceIndex(0) name (M)
|
||||
3 >Emitted(22, 12) Source(19, 7) + SourceIndex(0) name (M)
|
||||
4 >Emitted(22, 13) Source(19, 8) + SourceIndex(0) name (M)
|
||||
5 >Emitted(22, 18) Source(19, 11) + SourceIndex(0) name (M)
|
||||
6 >Emitted(22, 21) Source(19, 14) + SourceIndex(0) name (M)
|
||||
7 >Emitted(22, 22) Source(19, 15) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>> var S;
|
||||
1 >^^^^
|
||||
2 > ^^^^
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
>
|
||||
2 > export module
|
||||
3 > S
|
||||
4 > {
|
||||
> // Emit M.Foo
|
||||
> Foo, <Foo />;
|
||||
>
|
||||
> // Emit S.Bar
|
||||
> Bar, <Bar />;
|
||||
> }
|
||||
1 >Emitted(23, 5) Source(21, 2) + SourceIndex(0) name (M)
|
||||
2 >Emitted(23, 9) Source(21, 16) + SourceIndex(0) name (M)
|
||||
3 >Emitted(23, 10) Source(21, 17) + SourceIndex(0) name (M)
|
||||
4 >Emitted(23, 11) Source(27, 3) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>> (function (S) {
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
6 > ^^^->
|
||||
1->
|
||||
2 > export module
|
||||
3 > S
|
||||
4 >
|
||||
5 > {
|
||||
1->Emitted(24, 5) Source(21, 2) + SourceIndex(0) name (M)
|
||||
2 >Emitted(24, 16) Source(21, 16) + SourceIndex(0) name (M)
|
||||
3 >Emitted(24, 17) Source(21, 17) + SourceIndex(0) name (M)
|
||||
4 >Emitted(24, 19) Source(21, 18) + SourceIndex(0) name (M)
|
||||
5 >Emitted(24, 20) Source(21, 19) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>> // Emit M.Foo
|
||||
1->^^^^^^^^
|
||||
2 >
|
||||
3 > ^^^^^^^^^^^^^
|
||||
4 > ^^^^^->
|
||||
1->
|
||||
> // Emit M.Foo
|
||||
>
|
||||
2 >
|
||||
3 > // Emit M.Foo
|
||||
1->Emitted(25, 9) Source(23, 3) + SourceIndex(0) name (M.S)
|
||||
2 >Emitted(25, 9) Source(22, 3) + SourceIndex(0) name (M.S)
|
||||
3 >Emitted(25, 22) Source(22, 16) + SourceIndex(0) name (M.S)
|
||||
---
|
||||
>>> M.Foo, <M.Foo />;
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^
|
||||
3 > ^^
|
||||
4 > ^
|
||||
5 > ^^^^^
|
||||
6 > ^^^
|
||||
7 > ^
|
||||
1->
|
||||
>
|
||||
2 > Foo
|
||||
3 > ,
|
||||
4 > <
|
||||
5 > Foo
|
||||
6 > />
|
||||
7 > ;
|
||||
1->Emitted(26, 9) Source(23, 3) + SourceIndex(0) name (M.S)
|
||||
2 >Emitted(26, 14) Source(23, 6) + SourceIndex(0) name (M.S)
|
||||
3 >Emitted(26, 16) Source(23, 8) + SourceIndex(0) name (M.S)
|
||||
4 >Emitted(26, 17) Source(23, 9) + SourceIndex(0) name (M.S)
|
||||
5 >Emitted(26, 22) Source(23, 12) + SourceIndex(0) name (M.S)
|
||||
6 >Emitted(26, 25) Source(23, 15) + SourceIndex(0) name (M.S)
|
||||
7 >Emitted(26, 26) Source(23, 16) + SourceIndex(0) name (M.S)
|
||||
---
|
||||
>>> // Emit S.Bar
|
||||
1 >^^^^^^^^
|
||||
2 >
|
||||
3 > ^^^^^^^^^^^^^
|
||||
4 > ^^^^^->
|
||||
1 >
|
||||
>
|
||||
> // Emit S.Bar
|
||||
>
|
||||
2 >
|
||||
3 > // Emit S.Bar
|
||||
1 >Emitted(27, 9) Source(26, 3) + SourceIndex(0) name (M.S)
|
||||
2 >Emitted(27, 9) Source(25, 3) + SourceIndex(0) name (M.S)
|
||||
3 >Emitted(27, 22) Source(25, 16) + SourceIndex(0) name (M.S)
|
||||
---
|
||||
>>> S.Bar, <S.Bar />;
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^
|
||||
3 > ^^
|
||||
4 > ^
|
||||
5 > ^^^^^
|
||||
6 > ^^^
|
||||
7 > ^
|
||||
8 > ^^^^^^->
|
||||
1->
|
||||
>
|
||||
2 > Bar
|
||||
3 > ,
|
||||
4 > <
|
||||
5 > Bar
|
||||
6 > />
|
||||
7 > ;
|
||||
1->Emitted(28, 9) Source(26, 3) + SourceIndex(0) name (M.S)
|
||||
2 >Emitted(28, 14) Source(26, 6) + SourceIndex(0) name (M.S)
|
||||
3 >Emitted(28, 16) Source(26, 8) + SourceIndex(0) name (M.S)
|
||||
4 >Emitted(28, 17) Source(26, 9) + SourceIndex(0) name (M.S)
|
||||
5 >Emitted(28, 22) Source(26, 12) + SourceIndex(0) name (M.S)
|
||||
6 >Emitted(28, 25) Source(26, 15) + SourceIndex(0) name (M.S)
|
||||
7 >Emitted(28, 26) Source(26, 16) + SourceIndex(0) name (M.S)
|
||||
---
|
||||
>>> })(S = M.S || (M.S = {}));
|
||||
1->^^^^
|
||||
2 > ^
|
||||
3 > ^^
|
||||
4 > ^
|
||||
5 > ^^^
|
||||
6 > ^^^
|
||||
7 > ^^^^^
|
||||
8 > ^^^
|
||||
9 > ^^^^^^^^
|
||||
1->
|
||||
>
|
||||
2 > }
|
||||
3 >
|
||||
4 > S
|
||||
5 >
|
||||
6 > S
|
||||
7 >
|
||||
8 > S
|
||||
9 > {
|
||||
> // Emit M.Foo
|
||||
> Foo, <Foo />;
|
||||
>
|
||||
> // Emit S.Bar
|
||||
> Bar, <Bar />;
|
||||
> }
|
||||
1->Emitted(29, 5) Source(27, 2) + SourceIndex(0) name (M.S)
|
||||
2 >Emitted(29, 6) Source(27, 3) + SourceIndex(0) name (M.S)
|
||||
3 >Emitted(29, 8) Source(21, 16) + SourceIndex(0) name (M)
|
||||
4 >Emitted(29, 9) Source(21, 17) + SourceIndex(0) name (M)
|
||||
5 >Emitted(29, 12) Source(21, 16) + SourceIndex(0) name (M)
|
||||
6 >Emitted(29, 15) Source(21, 17) + SourceIndex(0) name (M)
|
||||
7 >Emitted(29, 20) Source(21, 16) + SourceIndex(0) name (M)
|
||||
8 >Emitted(29, 23) Source(21, 17) + SourceIndex(0) name (M)
|
||||
9 >Emitted(29, 31) Source(27, 3) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>>})(M || (M = {}));
|
||||
1 >
|
||||
2 >^
|
||||
3 > ^^
|
||||
4 > ^
|
||||
5 > ^^^^^
|
||||
6 > ^
|
||||
7 > ^^^^^^^^
|
||||
1 >
|
||||
>
|
||||
>
|
||||
2 >}
|
||||
3 >
|
||||
4 > M
|
||||
5 >
|
||||
6 > M
|
||||
7 > {
|
||||
> // Emit M.Foo
|
||||
> Foo, <Foo />;
|
||||
>
|
||||
> export module S {
|
||||
> // Emit M.Foo
|
||||
> Foo, <Foo />;
|
||||
>
|
||||
> // Emit S.Bar
|
||||
> Bar, <Bar />;
|
||||
> }
|
||||
>
|
||||
> }
|
||||
1 >Emitted(30, 1) Source(29, 1) + SourceIndex(0) name (M)
|
||||
2 >Emitted(30, 2) Source(29, 2) + SourceIndex(0) name (M)
|
||||
3 >Emitted(30, 4) Source(17, 8) + SourceIndex(0)
|
||||
4 >Emitted(30, 5) Source(17, 9) + SourceIndex(0)
|
||||
5 >Emitted(30, 10) Source(17, 8) + SourceIndex(0)
|
||||
6 >Emitted(30, 11) Source(17, 9) + SourceIndex(0)
|
||||
7 >Emitted(30, 19) Source(29, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>var M;
|
||||
1 >
|
||||
2 >^^^^
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
>
|
||||
2 >module
|
||||
3 > M
|
||||
4 > {
|
||||
> // Emit M.S.Bar
|
||||
> S.Bar, <S.Bar />;
|
||||
> }
|
||||
1 >Emitted(31, 1) Source(31, 1) + SourceIndex(0)
|
||||
2 >Emitted(31, 5) Source(31, 8) + SourceIndex(0)
|
||||
3 >Emitted(31, 6) Source(31, 9) + SourceIndex(0)
|
||||
4 >Emitted(31, 7) Source(34, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>(function (M) {
|
||||
1->
|
||||
2 >^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
6 > ^^^^^->
|
||||
1->
|
||||
2 >module
|
||||
3 > M
|
||||
4 >
|
||||
5 > {
|
||||
1->Emitted(32, 1) Source(31, 1) + SourceIndex(0)
|
||||
2 >Emitted(32, 12) Source(31, 8) + SourceIndex(0)
|
||||
3 >Emitted(32, 13) Source(31, 9) + SourceIndex(0)
|
||||
4 >Emitted(32, 15) Source(31, 10) + SourceIndex(0)
|
||||
5 >Emitted(32, 16) Source(31, 11) + SourceIndex(0)
|
||||
---
|
||||
>>> // Emit M.S.Bar
|
||||
1->^^^^
|
||||
2 >
|
||||
3 > ^^^^^^^^^^^^^^^
|
||||
4 > ^^^^^^^->
|
||||
1->
|
||||
> // Emit M.S.Bar
|
||||
>
|
||||
2 >
|
||||
3 > // Emit M.S.Bar
|
||||
1->Emitted(33, 5) Source(33, 2) + SourceIndex(0) name (M)
|
||||
2 >Emitted(33, 5) Source(32, 2) + SourceIndex(0) name (M)
|
||||
3 >Emitted(33, 20) Source(32, 17) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>> M.S.Bar, <M.S.Bar />;
|
||||
1->^^^^
|
||||
2 > ^^^
|
||||
3 > ^
|
||||
4 > ^^^
|
||||
5 > ^^
|
||||
6 > ^
|
||||
7 > ^^^
|
||||
8 > ^
|
||||
9 > ^^^
|
||||
10> ^^^
|
||||
11> ^
|
||||
1->
|
||||
>
|
||||
2 > S
|
||||
3 > .
|
||||
4 > Bar
|
||||
5 > ,
|
||||
6 > <
|
||||
7 > S
|
||||
8 > .
|
||||
9 > Bar
|
||||
10> />
|
||||
11> ;
|
||||
1->Emitted(34, 5) Source(33, 2) + SourceIndex(0) name (M)
|
||||
2 >Emitted(34, 8) Source(33, 3) + SourceIndex(0) name (M)
|
||||
3 >Emitted(34, 9) Source(33, 4) + SourceIndex(0) name (M)
|
||||
4 >Emitted(34, 12) Source(33, 7) + SourceIndex(0) name (M)
|
||||
5 >Emitted(34, 14) Source(33, 9) + SourceIndex(0) name (M)
|
||||
6 >Emitted(34, 15) Source(33, 10) + SourceIndex(0) name (M)
|
||||
7 >Emitted(34, 18) Source(33, 11) + SourceIndex(0) name (M)
|
||||
8 >Emitted(34, 19) Source(33, 12) + SourceIndex(0) name (M)
|
||||
9 >Emitted(34, 22) Source(33, 15) + SourceIndex(0) name (M)
|
||||
10>Emitted(34, 25) Source(33, 18) + SourceIndex(0) name (M)
|
||||
11>Emitted(34, 26) Source(33, 19) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>>})(M || (M = {}));
|
||||
1 >
|
||||
2 >^
|
||||
3 > ^^
|
||||
4 > ^
|
||||
5 > ^^^^^
|
||||
6 > ^
|
||||
7 > ^^^^^^^^
|
||||
1 >
|
||||
>
|
||||
2 >}
|
||||
3 >
|
||||
4 > M
|
||||
5 >
|
||||
6 > M
|
||||
7 > {
|
||||
> // Emit M.S.Bar
|
||||
> S.Bar, <S.Bar />;
|
||||
> }
|
||||
1 >Emitted(35, 1) Source(34, 1) + SourceIndex(0) name (M)
|
||||
2 >Emitted(35, 2) Source(34, 2) + SourceIndex(0) name (M)
|
||||
3 >Emitted(35, 4) Source(31, 8) + SourceIndex(0)
|
||||
4 >Emitted(35, 5) Source(31, 9) + SourceIndex(0)
|
||||
5 >Emitted(35, 10) Source(31, 8) + SourceIndex(0)
|
||||
6 >Emitted(35, 11) Source(31, 9) + SourceIndex(0)
|
||||
7 >Emitted(35, 19) Source(34, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>var M;
|
||||
1 >
|
||||
2 >^^^^
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
>
|
||||
2 >module
|
||||
3 > M
|
||||
4 > {
|
||||
> var M = 100;
|
||||
> // Emit M_1.Foo
|
||||
> Foo, <Foo />;
|
||||
> }
|
||||
1 >Emitted(36, 1) Source(36, 1) + SourceIndex(0)
|
||||
2 >Emitted(36, 5) Source(36, 8) + SourceIndex(0)
|
||||
3 >Emitted(36, 6) Source(36, 9) + SourceIndex(0)
|
||||
4 >Emitted(36, 7) Source(40, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>(function (M_1) {
|
||||
1->
|
||||
2 >^^^^^^^^^^^
|
||||
3 > ^^^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
1->
|
||||
2 >module
|
||||
3 > M
|
||||
4 >
|
||||
5 > {
|
||||
1->Emitted(37, 1) Source(36, 1) + SourceIndex(0)
|
||||
2 >Emitted(37, 12) Source(36, 8) + SourceIndex(0)
|
||||
3 >Emitted(37, 15) Source(36, 9) + SourceIndex(0)
|
||||
4 >Emitted(37, 17) Source(36, 10) + SourceIndex(0)
|
||||
5 >Emitted(37, 18) Source(36, 11) + SourceIndex(0)
|
||||
---
|
||||
>>> var M = 100;
|
||||
1 >^^^^
|
||||
2 > ^^^^
|
||||
3 > ^
|
||||
4 > ^^^
|
||||
5 > ^^^
|
||||
6 > ^
|
||||
7 > ^^^^->
|
||||
1 >
|
||||
>
|
||||
2 > var
|
||||
3 > M
|
||||
4 > =
|
||||
5 > 100
|
||||
6 > ;
|
||||
1 >Emitted(38, 5) Source(37, 2) + SourceIndex(0) name (M)
|
||||
2 >Emitted(38, 9) Source(37, 6) + SourceIndex(0) name (M)
|
||||
3 >Emitted(38, 10) Source(37, 7) + SourceIndex(0) name (M)
|
||||
4 >Emitted(38, 13) Source(37, 10) + SourceIndex(0) name (M)
|
||||
5 >Emitted(38, 16) Source(37, 13) + SourceIndex(0) name (M)
|
||||
6 >Emitted(38, 17) Source(37, 14) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>> // Emit M_1.Foo
|
||||
1->^^^^
|
||||
2 >
|
||||
3 > ^^^^^^^^^^^^^^^
|
||||
4 > ^^^^^^^->
|
||||
1->
|
||||
> // Emit M_1.Foo
|
||||
>
|
||||
2 >
|
||||
3 > // Emit M_1.Foo
|
||||
1->Emitted(39, 5) Source(39, 2) + SourceIndex(0) name (M)
|
||||
2 >Emitted(39, 5) Source(38, 2) + SourceIndex(0) name (M)
|
||||
3 >Emitted(39, 20) Source(38, 17) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>> M_1.Foo, <M_1.Foo />;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^
|
||||
3 > ^^
|
||||
4 > ^
|
||||
5 > ^^^^^^^
|
||||
6 > ^^^
|
||||
7 > ^
|
||||
1->
|
||||
>
|
||||
2 > Foo
|
||||
3 > ,
|
||||
4 > <
|
||||
5 > Foo
|
||||
6 > />
|
||||
7 > ;
|
||||
1->Emitted(40, 5) Source(39, 2) + SourceIndex(0) name (M)
|
||||
2 >Emitted(40, 12) Source(39, 5) + SourceIndex(0) name (M)
|
||||
3 >Emitted(40, 14) Source(39, 7) + SourceIndex(0) name (M)
|
||||
4 >Emitted(40, 15) Source(39, 8) + SourceIndex(0) name (M)
|
||||
5 >Emitted(40, 22) Source(39, 11) + SourceIndex(0) name (M)
|
||||
6 >Emitted(40, 25) Source(39, 14) + SourceIndex(0) name (M)
|
||||
7 >Emitted(40, 26) Source(39, 15) + SourceIndex(0) name (M)
|
||||
---
|
||||
>>>})(M || (M = {}));
|
||||
1 >
|
||||
2 >^
|
||||
3 > ^^
|
||||
4 > ^
|
||||
5 > ^^^^^
|
||||
6 > ^
|
||||
7 > ^^^^^^^^
|
||||
8 > ^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
2 >}
|
||||
3 >
|
||||
4 > M
|
||||
5 >
|
||||
6 > M
|
||||
7 > {
|
||||
> var M = 100;
|
||||
> // Emit M_1.Foo
|
||||
> Foo, <Foo />;
|
||||
> }
|
||||
1 >Emitted(41, 1) Source(40, 1) + SourceIndex(0) name (M)
|
||||
2 >Emitted(41, 2) Source(40, 2) + SourceIndex(0) name (M)
|
||||
3 >Emitted(41, 4) Source(36, 8) + SourceIndex(0)
|
||||
4 >Emitted(41, 5) Source(36, 9) + SourceIndex(0)
|
||||
5 >Emitted(41, 10) Source(36, 8) + SourceIndex(0)
|
||||
6 >Emitted(41, 11) Source(36, 9) + SourceIndex(0)
|
||||
7 >Emitted(41, 19) Source(40, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=tsxEmit3.jsx.map
|
||||
@@ -1,25 +1,26 @@
|
||||
=== tests/cases/conformance/jsx/tsxEmit3.tsx ===
|
||||
|
||||
declare module JSX {
|
||||
>JSX : Symbol(JSX, Decl(tsxEmit3.tsx, 0, 0))
|
||||
|
||||
interface Element { }
|
||||
>Element : Symbol(Element, Decl(tsxEmit3.tsx, 0, 20))
|
||||
>Element : Symbol(Element, Decl(tsxEmit3.tsx, 1, 20))
|
||||
|
||||
interface IntrinsicElements { }
|
||||
>IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxEmit3.tsx, 1, 22))
|
||||
>IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxEmit3.tsx, 2, 22))
|
||||
}
|
||||
|
||||
module M {
|
||||
>M : Symbol(M, Decl(tsxEmit3.tsx, 3, 1), Decl(tsxEmit3.tsx, 13, 1), Decl(tsxEmit3.tsx, 27, 1), Decl(tsxEmit3.tsx, 32, 1))
|
||||
>M : Symbol(M, Decl(tsxEmit3.tsx, 4, 1), Decl(tsxEmit3.tsx, 14, 1), Decl(tsxEmit3.tsx, 28, 1), Decl(tsxEmit3.tsx, 33, 1))
|
||||
|
||||
export class Foo { constructor() { } }
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 5, 10))
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10))
|
||||
|
||||
export module S {
|
||||
>S : Symbol(S, Decl(tsxEmit3.tsx, 6, 39), Decl(tsxEmit3.tsx, 17, 14))
|
||||
>S : Symbol(S, Decl(tsxEmit3.tsx, 7, 39), Decl(tsxEmit3.tsx, 18, 14))
|
||||
|
||||
export class Bar { }
|
||||
>Bar : Symbol(Bar, Decl(tsxEmit3.tsx, 7, 18))
|
||||
>Bar : Symbol(Bar, Decl(tsxEmit3.tsx, 8, 18))
|
||||
|
||||
// Emit Foo
|
||||
// Foo, <Foo />;
|
||||
@@ -27,49 +28,49 @@ module M {
|
||||
}
|
||||
|
||||
module M {
|
||||
>M : Symbol(M, Decl(tsxEmit3.tsx, 3, 1), Decl(tsxEmit3.tsx, 13, 1), Decl(tsxEmit3.tsx, 27, 1), Decl(tsxEmit3.tsx, 32, 1))
|
||||
>M : Symbol(M, Decl(tsxEmit3.tsx, 4, 1), Decl(tsxEmit3.tsx, 14, 1), Decl(tsxEmit3.tsx, 28, 1), Decl(tsxEmit3.tsx, 33, 1))
|
||||
|
||||
// Emit M.Foo
|
||||
Foo, <Foo />;
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 5, 10))
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 5, 10))
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10))
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10))
|
||||
|
||||
export module S {
|
||||
>S : Symbol(S, Decl(tsxEmit3.tsx, 6, 39), Decl(tsxEmit3.tsx, 17, 14))
|
||||
>S : Symbol(S, Decl(tsxEmit3.tsx, 7, 39), Decl(tsxEmit3.tsx, 18, 14))
|
||||
|
||||
// Emit M.Foo
|
||||
Foo, <Foo />;
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 5, 10))
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 5, 10))
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10))
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10))
|
||||
|
||||
// Emit S.Bar
|
||||
Bar, <Bar />;
|
||||
>Bar : Symbol(Bar, Decl(tsxEmit3.tsx, 7, 18))
|
||||
>Bar : Symbol(Bar, Decl(tsxEmit3.tsx, 7, 18))
|
||||
>Bar : Symbol(Bar, Decl(tsxEmit3.tsx, 8, 18))
|
||||
>Bar : Symbol(Bar, Decl(tsxEmit3.tsx, 8, 18))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module M {
|
||||
>M : Symbol(M, Decl(tsxEmit3.tsx, 3, 1), Decl(tsxEmit3.tsx, 13, 1), Decl(tsxEmit3.tsx, 27, 1), Decl(tsxEmit3.tsx, 32, 1))
|
||||
>M : Symbol(M, Decl(tsxEmit3.tsx, 4, 1), Decl(tsxEmit3.tsx, 14, 1), Decl(tsxEmit3.tsx, 28, 1), Decl(tsxEmit3.tsx, 33, 1))
|
||||
|
||||
// Emit M.S.Bar
|
||||
S.Bar, <S.Bar />;
|
||||
>S.Bar : Symbol(S.Bar, Decl(tsxEmit3.tsx, 7, 18))
|
||||
>S : Symbol(S, Decl(tsxEmit3.tsx, 6, 39), Decl(tsxEmit3.tsx, 17, 14))
|
||||
>Bar : Symbol(S.Bar, Decl(tsxEmit3.tsx, 7, 18))
|
||||
>Bar : Symbol(S.Bar, Decl(tsxEmit3.tsx, 7, 18))
|
||||
>S.Bar : Symbol(S.Bar, Decl(tsxEmit3.tsx, 8, 18))
|
||||
>S : Symbol(S, Decl(tsxEmit3.tsx, 7, 39), Decl(tsxEmit3.tsx, 18, 14))
|
||||
>Bar : Symbol(S.Bar, Decl(tsxEmit3.tsx, 8, 18))
|
||||
>Bar : Symbol(S.Bar, Decl(tsxEmit3.tsx, 8, 18))
|
||||
}
|
||||
|
||||
module M {
|
||||
>M : Symbol(M, Decl(tsxEmit3.tsx, 3, 1), Decl(tsxEmit3.tsx, 13, 1), Decl(tsxEmit3.tsx, 27, 1), Decl(tsxEmit3.tsx, 32, 1))
|
||||
>M : Symbol(M, Decl(tsxEmit3.tsx, 4, 1), Decl(tsxEmit3.tsx, 14, 1), Decl(tsxEmit3.tsx, 28, 1), Decl(tsxEmit3.tsx, 33, 1))
|
||||
|
||||
var M = 100;
|
||||
>M : Symbol(M, Decl(tsxEmit3.tsx, 35, 4))
|
||||
>M : Symbol(M, Decl(tsxEmit3.tsx, 36, 4))
|
||||
|
||||
// Emit M_1.Foo
|
||||
Foo, <Foo />;
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 5, 10))
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 5, 10))
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10))
|
||||
>Foo : Symbol(Foo, Decl(tsxEmit3.tsx, 6, 10))
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/jsx/tsxEmit3.tsx ===
|
||||
|
||||
declare module JSX {
|
||||
>JSX : any
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
//// [tests/cases/conformance/jsx/tsxExternalModuleEmit2.tsx] ////
|
||||
|
||||
//// [modules.d.ts]
|
||||
|
||||
declare module 'mod' {
|
||||
var y: any;
|
||||
export default y;
|
||||
}
|
||||
|
||||
//// [app.tsx]
|
||||
import Main from 'mod';
|
||||
declare var Foo, React;
|
||||
// Should see mod_1['default'] in emit here
|
||||
<Foo handler={Main}></Foo>;
|
||||
// Should see mod_1['default'] in emit here
|
||||
<Foo {...Main}></Foo>;
|
||||
|
||||
|
||||
|
||||
//// [app.js]
|
||||
var mod_1 = require('mod');
|
||||
// Should see mod_1['default'] in emit here
|
||||
React.createElement(Foo, {"handler": mod_1["default"]});
|
||||
// Should see mod_1['default'] in emit here
|
||||
React.createElement(Foo, React.__spread({}, mod_1["default"]));
|
||||
@@ -0,0 +1,28 @@
|
||||
=== tests/cases/conformance/jsx/modules.d.ts ===
|
||||
|
||||
declare module 'mod' {
|
||||
var y: any;
|
||||
>y : Symbol(y, Decl(modules.d.ts, 2, 5))
|
||||
|
||||
export default y;
|
||||
>y : Symbol(y, Decl(modules.d.ts, 2, 5))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/jsx/app.tsx ===
|
||||
import Main from 'mod';
|
||||
>Main : Symbol(Main, Decl(app.tsx, 0, 6))
|
||||
|
||||
declare var Foo, React;
|
||||
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
|
||||
>React : Symbol(React, Decl(app.tsx, 1, 16))
|
||||
|
||||
// Should see mod_1['default'] in emit here
|
||||
<Foo handler={Main}></Foo>;
|
||||
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
|
||||
>handler : Symbol(unknown)
|
||||
|
||||
// Should see mod_1['default'] in emit here
|
||||
<Foo {...Main}></Foo>;
|
||||
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
=== tests/cases/conformance/jsx/modules.d.ts ===
|
||||
|
||||
declare module 'mod' {
|
||||
var y: any;
|
||||
>y : any
|
||||
|
||||
export default y;
|
||||
>y : any
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/jsx/app.tsx ===
|
||||
import Main from 'mod';
|
||||
>Main : any
|
||||
|
||||
declare var Foo, React;
|
||||
>Foo : any
|
||||
>React : any
|
||||
|
||||
// Should see mod_1['default'] in emit here
|
||||
<Foo handler={Main}></Foo>;
|
||||
><Foo handler={Main}></Foo> : any
|
||||
>Foo : any
|
||||
>handler : any
|
||||
>Main : any
|
||||
>Foo : any
|
||||
|
||||
// Should see mod_1['default'] in emit here
|
||||
<Foo {...Main}></Foo>;
|
||||
><Foo {...Main}></Foo> : any
|
||||
>Foo : any
|
||||
>Main : any
|
||||
>Foo : any
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
var x = {one: 1};
|
||||
var y: {[index:string]: any};
|
||||
|
||||
x = y;
|
||||
y = x;
|
||||
var x = { one: 1 };
|
||||
var y: { [index: string]: any };
|
||||
var z: { [index: number]: any };
|
||||
x = y; // Error
|
||||
y = x; // Ok because index signature type is any
|
||||
x = z; // Error
|
||||
z = x; // Ok because index signature type is any
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
class C extends null {
|
||||
constructor() {
|
||||
super();
|
||||
return Object.create(null);
|
||||
}
|
||||
}
|
||||
|
||||
class D extends null {
|
||||
constructor() {
|
||||
return Object.create(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// @noemithelpers: true
|
||||
// @experimentaldecorators: true
|
||||
// @emitdecoratormetadata: true
|
||||
// @target: es5
|
||||
|
||||
declare var decorator: any;
|
||||
|
||||
class MyClass {
|
||||
constructor(test: string, test2: number) {
|
||||
|
||||
}
|
||||
|
||||
@decorator
|
||||
doSomething() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,5 +3,5 @@
|
||||
(...arg) => 103;
|
||||
(...arg:number [] = []) => 104;
|
||||
|
||||
// Non optional parameter following an optional one
|
||||
// Uninitialized parameter makes the initialized one required
|
||||
(arg1 = 1, arg2) => 1;
|
||||
@@ -0,0 +1,5 @@
|
||||
function f<T extends { "0": (p1: number) => number }>(p: T): T {
|
||||
return p;
|
||||
}
|
||||
|
||||
var v = f([x => x]);
|
||||
@@ -0,0 +1,5 @@
|
||||
function f<T extends [(p1: number) => number]>(p: T): T {
|
||||
return p;
|
||||
}
|
||||
|
||||
var v = f([x => x]);
|
||||
@@ -0,0 +1,5 @@
|
||||
function f<T extends ((p1: number) => number)[]>(p: T): T {
|
||||
return p;
|
||||
}
|
||||
|
||||
var v = f([x => x]);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user