mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Merge branch 'master' into fixDeFaultOfFindAllRefsToMaster
Conflicts: src/compiler/checker.ts src/compiler/types.ts
This commit is contained in:
commit
abd7db7614
1033 files changed
+29850
-20845
No files matched your search
@@ -75,26 +75,26 @@ function delint(sourceFile) {
|
||||
delintNode(sourceFile);
|
||||
function delintNode(node) {
|
||||
switch (node.kind) {
|
||||
case 187 /* ForStatement */:
|
||||
case 188 /* ForInStatement */:
|
||||
case 186 /* WhileStatement */:
|
||||
case 185 /* DoStatement */:
|
||||
if (node.statement.kind !== 180 /* Block */) {
|
||||
case 189 /* ForStatement */:
|
||||
case 190 /* ForInStatement */:
|
||||
case 188 /* WhileStatement */:
|
||||
case 187 /* DoStatement */:
|
||||
if (node.statement.kind !== 182 /* Block */) {
|
||||
report(node, "A looping statement's contents should be wrapped in a block body.");
|
||||
}
|
||||
break;
|
||||
case 184 /* IfStatement */:
|
||||
case 186 /* IfStatement */:
|
||||
var ifStatement = node;
|
||||
if (ifStatement.thenStatement.kind !== 180 /* Block */) {
|
||||
if (ifStatement.thenStatement.kind !== 182 /* Block */) {
|
||||
report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.");
|
||||
}
|
||||
if (ifStatement.elseStatement &&
|
||||
ifStatement.elseStatement.kind !== 180 /* Block */ &&
|
||||
ifStatement.elseStatement.kind !== 184 /* IfStatement */) {
|
||||
ifStatement.elseStatement.kind !== 182 /* Block */ &&
|
||||
ifStatement.elseStatement.kind !== 186 /* IfStatement */) {
|
||||
report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.");
|
||||
}
|
||||
break;
|
||||
case 170 /* BinaryExpression */:
|
||||
case 172 /* BinaryExpression */:
|
||||
var op = node.operatorToken.kind;
|
||||
if (op === 28 /* EqualsEqualsToken */ || op == 29 /* ExclamationEqualsToken */) {
|
||||
report(node, "Use '===' and '!=='.");
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts(1,13): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts(1,14): error TS1110: Type expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts (1 errors) ====
|
||||
var v = (a): => {
|
||||
|
||||
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
~~
|
||||
!!! error TS1110: Type expected.
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ for (let v of []) {
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var v = _a[_i];
|
||||
v;
|
||||
for (var _b = 0, _c = [v]; _b < _c.length; _b++) {
|
||||
for (var _b = 0, _c = [v_1]; _b < _c.length; _b++) {
|
||||
var v_1 = _c[_b];
|
||||
var x = v_1;
|
||||
v_1++;
|
||||
|
||||
@@ -10,7 +10,7 @@ for (let v of []) {
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var v = _a[_i];
|
||||
var v_1;
|
||||
for (var _b = 0, _c = [v]; _b < _c.length; _b++) {
|
||||
for (var _b = 0, _c = [v_2]; _b < _c.length; _b++) {
|
||||
var v_2 = _c[_b];
|
||||
var v_3;
|
||||
}
|
||||
|
||||
+1
-2
@@ -24,8 +24,7 @@ module A {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var A;
|
||||
(function (A) {
|
||||
|
||||
+1
-2
@@ -28,8 +28,7 @@ module A {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var A;
|
||||
(function (A) {
|
||||
|
||||
@@ -35,14 +35,14 @@ function f1(x: Color | string) {
|
||||
}
|
||||
|
||||
function f2(x: Color | string | string[]) {
|
||||
>f2 : (x: string | string[] | Color) => void
|
||||
>x : string | string[] | Color
|
||||
>f2 : (x: string | Color | string[]) => void
|
||||
>x : string | Color | string[]
|
||||
>Color : Color
|
||||
|
||||
if (typeof x === "object") {
|
||||
>typeof x === "object" : boolean
|
||||
>typeof x : string
|
||||
>x : string | string[] | Color
|
||||
>x : string | Color | string[]
|
||||
>"object" : string
|
||||
|
||||
var y = x;
|
||||
@@ -55,7 +55,7 @@ function f2(x: Color | string | string[]) {
|
||||
if (typeof x === "number") {
|
||||
>typeof x === "number" : boolean
|
||||
>typeof x : string
|
||||
>x : string | string[] | Color
|
||||
>x : string | Color | string[]
|
||||
>"number" : string
|
||||
|
||||
var z = x;
|
||||
@@ -77,7 +77,7 @@ function f2(x: Color | string | string[]) {
|
||||
if (typeof x === "string") {
|
||||
>typeof x === "string" : boolean
|
||||
>typeof x : string
|
||||
>x : string | string[] | Color
|
||||
>x : string | Color | string[]
|
||||
>"string" : string
|
||||
|
||||
var a = x;
|
||||
@@ -89,11 +89,11 @@ function f2(x: Color | string | string[]) {
|
||||
}
|
||||
else {
|
||||
var b = x;
|
||||
>b : string[] | Color
|
||||
>x : string[] | Color
|
||||
>b : Color | string[]
|
||||
>x : Color | string[]
|
||||
|
||||
var b: Color | string[];
|
||||
>b : string[] | Color
|
||||
>b : Color | string[]
|
||||
>Color : Color
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration11_es6.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration11_es6.ts(2,1): error TS1212: Identifier expected. 'let' is a reserved word in strict mode
|
||||
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration11_es6.ts(2,1): error TS2304: Cannot find name 'let'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration11_es6.ts (1 errors) ====
|
||||
==== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration11_es6.ts (2 errors) ====
|
||||
"use strict";
|
||||
let
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
~~~
|
||||
!!! error TS1212: Identifier expected. 'let' is a reserved word in strict mode
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
@@ -4,4 +4,4 @@ let
|
||||
|
||||
//// [VariableDeclaration11_es6.js]
|
||||
"use strict";
|
||||
let ;
|
||||
let;
|
||||
@@ -1,8 +1,14 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts(2,1): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts(2,1): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts(2,1): error TS2304: Cannot find name 'yield'.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts(2,7): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts (1 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts (3 errors) ====
|
||||
"use strict";
|
||||
yield(foo);
|
||||
~~~~~
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode
|
||||
~~~~~
|
||||
!!! error TS2304: Cannot find name 'yield'.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
@@ -4,4 +4,4 @@ yield(foo);
|
||||
|
||||
//// [YieldExpression18_es6.js]
|
||||
"use strict";
|
||||
yield (foo);
|
||||
yield(foo);
|
||||
@@ -19,8 +19,7 @@ class ColoredPoint extends Point {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Point = (function () {
|
||||
function Point(x, y) {
|
||||
|
||||
@@ -28,8 +28,7 @@ class LanguageSpec_section_4_5_inference {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var A = (function () {
|
||||
function A() {
|
||||
|
||||
@@ -38,8 +38,7 @@ exports.Model = Model;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Backbone = require("aliasUsage1_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
|
||||
@@ -53,9 +53,9 @@ import Backbone = require("aliasUsage1_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -32,8 +32,7 @@ exports.Model = Model;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Backbone = require("aliasUsageInArray_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
|
||||
@@ -41,9 +41,9 @@ import Backbone = require("aliasUsageInArray_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -31,8 +31,7 @@ exports.Model = Model;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Backbone = require("aliasUsageInFunctionExpression_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
|
||||
@@ -42,9 +42,9 @@ import Backbone = require("aliasUsageInFunctionExpression_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -35,8 +35,7 @@ exports.Model = Model;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Backbone = require("aliasUsageInGenericFunction_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
|
||||
@@ -57,9 +57,9 @@ import Backbone = require("aliasUsageInGenericFunction_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -37,8 +37,7 @@ exports.Model = Model;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Backbone = require("aliasUsageInIndexerOfClass_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
|
||||
@@ -50,9 +50,9 @@ import Backbone = require("aliasUsageInIndexerOfClass_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -32,8 +32,7 @@ exports.Model = Model;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Backbone = require("aliasUsageInObjectLiteral_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
|
||||
@@ -55,9 +55,9 @@ import Backbone = require("aliasUsageInObjectLiteral_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -35,8 +35,7 @@ exports.Model = Model;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Backbone = require("aliasUsageInOrExpression_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
|
||||
@@ -79,9 +79,9 @@ import Backbone = require("aliasUsageInOrExpression_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -35,8 +35,7 @@ exports.Model = Model;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
@@ -51,8 +50,7 @@ exports.VisualizationModel = VisualizationModel;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var moduleA = require("aliasUsageInTypeArgumentOfExtendsClause_moduleA");
|
||||
var C = (function () {
|
||||
|
||||
@@ -25,7 +25,7 @@ class C<T extends IHasVisualizationModel> {
|
||||
}
|
||||
class D extends C<IHasVisualizationModel> {
|
||||
>D : D
|
||||
>C : C<T>
|
||||
>C : C<IHasVisualizationModel>
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
|
||||
x = moduleA;
|
||||
@@ -46,9 +46,9 @@ import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -31,8 +31,7 @@ exports.Model = Model;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Backbone = require("aliasUsageInVarAssignment_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
|
||||
@@ -37,9 +37,9 @@ import Backbone = require("aliasUsageInVarAssignment_backbone");
|
||||
|
||||
export class VisualizationModel extends Backbone.Model {
|
||||
>VisualizationModel : VisualizationModel
|
||||
>Backbone.Model : any
|
||||
>Backbone.Model : Backbone.Model
|
||||
>Backbone : typeof Backbone
|
||||
>Model : Backbone.Model
|
||||
>Model : typeof Backbone.Model
|
||||
|
||||
// interesting stuff here
|
||||
}
|
||||
|
||||
@@ -12,8 +12,7 @@ var t: number = f(x, x); // Not an error
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var A = (function () {
|
||||
function A() {
|
||||
|
||||
@@ -27,8 +27,7 @@ class Derived2<U extends String> extends Base2 { // error because of the prototy
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Base = (function () {
|
||||
function Base() {
|
||||
|
||||
@@ -17,8 +17,7 @@ class Derived<U extends String> extends Base { // error
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Base = (function () {
|
||||
function Base() {
|
||||
|
||||
@@ -89,8 +89,7 @@ arr_any = i1; // should be an error - is
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var C1 = (function () {
|
||||
function C1() {
|
||||
|
||||
@@ -63,8 +63,7 @@ arr_any = i1; // should be an error - is
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var C1 = (function () {
|
||||
function C1() {
|
||||
|
||||
@@ -111,8 +111,7 @@ module NonEmptyTypes {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var EmptyTypes;
|
||||
(function (EmptyTypes) {
|
||||
|
||||
@@ -55,8 +55,7 @@ var z3: { id: number }[] =
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Action = (function () {
|
||||
function Action() {
|
||||
|
||||
@@ -41,8 +41,7 @@ var context4: Base[] = [new Derived1(), new Derived1()];
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var arr1 = [[], [1], ['']];
|
||||
var arr2 = [[null], [1], ['']];
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Empty array literal with no contextual type has type Undefined[]
|
||||
|
||||
var arr1= [[], [1], ['']];
|
||||
>arr1 : (string[] | number[])[]
|
||||
>[[], [1], ['']] : (string[] | number[])[]
|
||||
>arr1 : (number[] | string[])[]
|
||||
>[[], [1], ['']] : (number[] | string[])[]
|
||||
>[] : undefined[]
|
||||
>[1] : number[]
|
||||
>1 : number
|
||||
@@ -11,8 +11,8 @@ var arr1= [[], [1], ['']];
|
||||
>'' : string
|
||||
|
||||
var arr2 = [[null], [1], ['']];
|
||||
>arr2 : (string[] | number[])[]
|
||||
>[[null], [1], ['']] : (string[] | number[])[]
|
||||
>arr2 : (number[] | string[])[]
|
||||
>[[null], [1], ['']] : (number[] | string[])[]
|
||||
>[null] : null[]
|
||||
>null : null
|
||||
>[1] : number[]
|
||||
|
||||
@@ -8,8 +8,8 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error
|
||||
Type '() => string | number | boolean' is not assignable to type '() => number'.
|
||||
Type 'string | number | boolean' is not assignable to type 'number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(32,5): error TS2322: Type '(string[] | number[])[]' is not assignable to type 'tup'.
|
||||
Property '0' is missing in type '(string[] | number[])[]'.
|
||||
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(32,5): error TS2322: Type '(number[] | string[])[]' is not assignable to type 'tup'.
|
||||
Property '0' is missing in type '(number[] | string[])[]'.
|
||||
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(33,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'.
|
||||
Property '0' is missing in type 'number[]'.
|
||||
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error TS2322: Type '(string | number)[]' is not assignable to type 'myArray'.
|
||||
@@ -68,8 +68,8 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error
|
||||
interface myArray2 extends Array<Number|String> { }
|
||||
var c0: tup = [...temp2]; // Error
|
||||
~~
|
||||
!!! error TS2322: Type '(string[] | number[])[]' is not assignable to type 'tup'.
|
||||
!!! error TS2322: Property '0' is missing in type '(string[] | number[])[]'.
|
||||
!!! error TS2322: Type '(number[] | string[])[]' is not assignable to type 'tup'.
|
||||
!!! error TS2322: Property '0' is missing in type '(number[] | string[])[]'.
|
||||
var c1: [number, number, number] = [...temp1]; // Error cannot assign number[] to [number, number, number]
|
||||
~~
|
||||
!!! error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'.
|
||||
|
||||
@@ -29,8 +29,7 @@ var as = [list, myDerivedList]; // List<number>[]
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var List = (function () {
|
||||
function List() {
|
||||
|
||||
@@ -17,7 +17,7 @@ class List<T> {
|
||||
class DerivedList<U> extends List<U> {
|
||||
>DerivedList : DerivedList<U>
|
||||
>U : U
|
||||
>List : List<T>
|
||||
>List : List<U>
|
||||
>U : U
|
||||
|
||||
foo: U;
|
||||
|
||||
@@ -100,8 +100,7 @@ var asserted2: any;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
// Arrow function used in with statement
|
||||
with (window) {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
//// [asiPreventsParsingAsAmbientExternalModule01.ts]
|
||||
|
||||
var declare: number;
|
||||
var module: string;
|
||||
|
||||
declare // this is the identifier 'declare'
|
||||
module // this is the identifier 'module'
|
||||
"my external module" // this is just a string
|
||||
{ } // this is a block body
|
||||
|
||||
//// [asiPreventsParsingAsAmbientExternalModule01.js]
|
||||
var declare;
|
||||
var module;
|
||||
declare; // this is the identifier 'declare'
|
||||
module; // this is the identifier 'module'
|
||||
"my external module"; // this is just a string
|
||||
{ } // this is a block body
|
||||
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/conformance/externalModules/asiPreventsParsingAsAmbientExternalModule01.ts ===
|
||||
|
||||
var declare: number;
|
||||
>declare : Symbol(declare, Decl(asiPreventsParsingAsAmbientExternalModule01.ts, 1, 3))
|
||||
|
||||
var module: string;
|
||||
>module : Symbol(module, Decl(asiPreventsParsingAsAmbientExternalModule01.ts, 2, 3))
|
||||
|
||||
declare // this is the identifier 'declare'
|
||||
>declare : Symbol(declare, Decl(asiPreventsParsingAsAmbientExternalModule01.ts, 1, 3))
|
||||
|
||||
module // this is the identifier 'module'
|
||||
>module : Symbol(module, Decl(asiPreventsParsingAsAmbientExternalModule01.ts, 2, 3))
|
||||
|
||||
"my external module" // this is just a string
|
||||
{ } // this is a block body
|
||||
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/conformance/externalModules/asiPreventsParsingAsAmbientExternalModule01.ts ===
|
||||
|
||||
var declare: number;
|
||||
>declare : number
|
||||
|
||||
var module: string;
|
||||
>module : string
|
||||
|
||||
declare // this is the identifier 'declare'
|
||||
>declare : number
|
||||
|
||||
module // this is the identifier 'module'
|
||||
>module : string
|
||||
|
||||
"my external module" // this is just a string
|
||||
>"my external module" : string
|
||||
|
||||
{ } // this is a block body
|
||||
@@ -0,0 +1,22 @@
|
||||
//// [asiPreventsParsingAsAmbientExternalModule02.ts]
|
||||
|
||||
var declare: number;
|
||||
var module: string;
|
||||
|
||||
module container {
|
||||
declare // this is the identifier 'declare'
|
||||
module // this is the identifier 'module'
|
||||
"my external module" // this is just a string
|
||||
{ } // this is a block body
|
||||
}
|
||||
|
||||
//// [asiPreventsParsingAsAmbientExternalModule02.js]
|
||||
var declare;
|
||||
var module;
|
||||
var container;
|
||||
(function (container) {
|
||||
declare; // this is the identifier 'declare'
|
||||
module; // this is the identifier 'module'
|
||||
"my external module"; // this is just a string
|
||||
{ } // this is a block body
|
||||
})(container || (container = {}));
|
||||
@@ -0,0 +1,20 @@
|
||||
=== tests/cases/conformance/externalModules/asiPreventsParsingAsAmbientExternalModule02.ts ===
|
||||
|
||||
var declare: number;
|
||||
>declare : Symbol(declare, Decl(asiPreventsParsingAsAmbientExternalModule02.ts, 1, 3))
|
||||
|
||||
var module: string;
|
||||
>module : Symbol(module, Decl(asiPreventsParsingAsAmbientExternalModule02.ts, 2, 3))
|
||||
|
||||
module container {
|
||||
>container : Symbol(container, Decl(asiPreventsParsingAsAmbientExternalModule02.ts, 2, 19))
|
||||
|
||||
declare // this is the identifier 'declare'
|
||||
>declare : Symbol(declare, Decl(asiPreventsParsingAsAmbientExternalModule02.ts, 1, 3))
|
||||
|
||||
module // this is the identifier 'module'
|
||||
>module : Symbol(module, Decl(asiPreventsParsingAsAmbientExternalModule02.ts, 2, 3))
|
||||
|
||||
"my external module" // this is just a string
|
||||
{ } // this is a block body
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/conformance/externalModules/asiPreventsParsingAsAmbientExternalModule02.ts ===
|
||||
|
||||
var declare: number;
|
||||
>declare : number
|
||||
|
||||
var module: string;
|
||||
>module : string
|
||||
|
||||
module container {
|
||||
>container : typeof container
|
||||
|
||||
declare // this is the identifier 'declare'
|
||||
>declare : number
|
||||
|
||||
module // this is the identifier 'module'
|
||||
>module : string
|
||||
|
||||
"my external module" // this is just a string
|
||||
>"my external module" : string
|
||||
|
||||
{ } // this is a block body
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [asiPreventsParsingAsInterface01.ts]
|
||||
|
||||
var interface: number, I: string;
|
||||
|
||||
interface // This should be the identifier 'interface'
|
||||
I // This should be the identifier 'I'
|
||||
{} // This should be a block body
|
||||
|
||||
//// [asiPreventsParsingAsInterface01.js]
|
||||
var interface, I;
|
||||
interface; // This should be the identifier 'interface'
|
||||
I; // This should be the identifier 'I'
|
||||
{ } // This should be a block body
|
||||
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface01.ts ===
|
||||
|
||||
var interface: number, I: string;
|
||||
>interface : Symbol(interface, Decl(asiPreventsParsingAsInterface01.ts, 1, 3))
|
||||
>I : Symbol(I, Decl(asiPreventsParsingAsInterface01.ts, 1, 22))
|
||||
|
||||
interface // This should be the identifier 'interface'
|
||||
>interface : Symbol(interface, Decl(asiPreventsParsingAsInterface01.ts, 1, 3))
|
||||
|
||||
I // This should be the identifier 'I'
|
||||
>I : Symbol(I, Decl(asiPreventsParsingAsInterface01.ts, 1, 22))
|
||||
|
||||
{} // This should be a block body
|
||||
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface01.ts ===
|
||||
|
||||
var interface: number, I: string;
|
||||
>interface : number
|
||||
>I : string
|
||||
|
||||
interface // This should be the identifier 'interface'
|
||||
>interface : number
|
||||
|
||||
I // This should be the identifier 'I'
|
||||
>I : string
|
||||
|
||||
{} // This should be a block body
|
||||
@@ -0,0 +1,14 @@
|
||||
//// [asiPreventsParsingAsInterface02.ts]
|
||||
|
||||
function f(interface: number, I: string) {
|
||||
interface // This should be the identifier 'interface'
|
||||
I // This should be the identifier 'I'
|
||||
{} // This should be a block body
|
||||
}
|
||||
|
||||
//// [asiPreventsParsingAsInterface02.js]
|
||||
function f(interface, I) {
|
||||
interface; // This should be the identifier 'interface'
|
||||
I; // This should be the identifier 'I'
|
||||
{ } // This should be a block body
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface02.ts ===
|
||||
|
||||
function f(interface: number, I: string) {
|
||||
>f : Symbol(f, Decl(asiPreventsParsingAsInterface02.ts, 0, 0))
|
||||
>interface : Symbol(interface, Decl(asiPreventsParsingAsInterface02.ts, 1, 11))
|
||||
>I : Symbol(I, Decl(asiPreventsParsingAsInterface02.ts, 1, 29))
|
||||
|
||||
interface // This should be the identifier 'interface'
|
||||
>interface : Symbol(interface, Decl(asiPreventsParsingAsInterface02.ts, 1, 11))
|
||||
|
||||
I // This should be the identifier 'I'
|
||||
>I : Symbol(I, Decl(asiPreventsParsingAsInterface02.ts, 1, 29))
|
||||
|
||||
{} // This should be a block body
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface02.ts ===
|
||||
|
||||
function f(interface: number, I: string) {
|
||||
>f : (interface: number, I: string) => void
|
||||
>interface : number
|
||||
>I : string
|
||||
|
||||
interface // This should be the identifier 'interface'
|
||||
>interface : number
|
||||
|
||||
I // This should be the identifier 'I'
|
||||
>I : string
|
||||
|
||||
{} // This should be a block body
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
//// [asiPreventsParsingAsInterface03.ts]
|
||||
|
||||
var interface: number, I: string;
|
||||
|
||||
namespace n {
|
||||
interface // This should be the identifier 'interface'
|
||||
I // This should be the identifier 'I'
|
||||
{} // This should be a block body
|
||||
}
|
||||
|
||||
//// [asiPreventsParsingAsInterface03.js]
|
||||
var interface, I;
|
||||
var n;
|
||||
(function (n) {
|
||||
interface; // This should be the identifier 'interface'
|
||||
I; // This should be the identifier 'I'
|
||||
{ } // This should be a block body
|
||||
})(n || (n = {}));
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface03.ts ===
|
||||
|
||||
var interface: number, I: string;
|
||||
>interface : Symbol(interface, Decl(asiPreventsParsingAsInterface03.ts, 1, 3))
|
||||
>I : Symbol(I, Decl(asiPreventsParsingAsInterface03.ts, 1, 22))
|
||||
|
||||
namespace n {
|
||||
>n : Symbol(n, Decl(asiPreventsParsingAsInterface03.ts, 1, 33))
|
||||
|
||||
interface // This should be the identifier 'interface'
|
||||
>interface : Symbol(interface, Decl(asiPreventsParsingAsInterface03.ts, 1, 3))
|
||||
|
||||
I // This should be the identifier 'I'
|
||||
>I : Symbol(I, Decl(asiPreventsParsingAsInterface03.ts, 1, 22))
|
||||
|
||||
{} // This should be a block body
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface03.ts ===
|
||||
|
||||
var interface: number, I: string;
|
||||
>interface : number
|
||||
>I : string
|
||||
|
||||
namespace n {
|
||||
>n : typeof n
|
||||
|
||||
interface // This should be the identifier 'interface'
|
||||
>interface : number
|
||||
|
||||
I // This should be the identifier 'I'
|
||||
>I : string
|
||||
|
||||
{} // This should be a block body
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
//// [asiPreventsParsingAsInterface04.ts]
|
||||
|
||||
var declare: boolean, interface: number, I: string;
|
||||
|
||||
declare // This should be the identifier 'declare'
|
||||
interface // This should be the identifier 'interface'
|
||||
I // This should be the identifier 'I'
|
||||
{} // This should be a block body
|
||||
|
||||
//// [asiPreventsParsingAsInterface04.js]
|
||||
var declare, interface, I;
|
||||
declare; // This should be the identifier 'declare'
|
||||
interface; // This should be the identifier 'interface'
|
||||
I; // This should be the identifier 'I'
|
||||
{ } // This should be a block body
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface04.ts ===
|
||||
|
||||
var declare: boolean, interface: number, I: string;
|
||||
>declare : Symbol(declare, Decl(asiPreventsParsingAsInterface04.ts, 1, 3))
|
||||
>interface : Symbol(interface, Decl(asiPreventsParsingAsInterface04.ts, 1, 21))
|
||||
>I : Symbol(I, Decl(asiPreventsParsingAsInterface04.ts, 1, 40))
|
||||
|
||||
declare // This should be the identifier 'declare'
|
||||
>declare : Symbol(declare, Decl(asiPreventsParsingAsInterface04.ts, 1, 3))
|
||||
|
||||
interface // This should be the identifier 'interface'
|
||||
>interface : Symbol(interface, Decl(asiPreventsParsingAsInterface04.ts, 1, 21))
|
||||
|
||||
I // This should be the identifier 'I'
|
||||
>I : Symbol(I, Decl(asiPreventsParsingAsInterface04.ts, 1, 40))
|
||||
|
||||
{} // This should be a block body
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface04.ts ===
|
||||
|
||||
var declare: boolean, interface: number, I: string;
|
||||
>declare : boolean
|
||||
>interface : number
|
||||
>I : string
|
||||
|
||||
declare // This should be the identifier 'declare'
|
||||
>declare : boolean
|
||||
|
||||
interface // This should be the identifier 'interface'
|
||||
>interface : number
|
||||
|
||||
I // This should be the identifier 'I'
|
||||
>I : string
|
||||
|
||||
{} // This should be a block body
|
||||
@@ -0,0 +1,24 @@
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface05.ts(3,5): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface05.ts(10,1): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface05.ts(11,1): error TS2304: Cannot find name 'I'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface05.ts (3 errors) ====
|
||||
"use strict"
|
||||
|
||||
var interface: number;
|
||||
~~~~~~~~~
|
||||
!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode
|
||||
|
||||
// 'interface' is a strict mode reserved word, and so it would be permissible
|
||||
// to allow 'interface' and the name of the interface to be on separate lines;
|
||||
// however, this complicates things, and so it is preferable to restrict interface
|
||||
// declarations such that their identifier must follow 'interface' on the same line.
|
||||
|
||||
interface // This should be the identifier 'interface'
|
||||
~~~~~~~~~
|
||||
!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode
|
||||
I // This should be the identifier 'I'
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'I'.
|
||||
{ } // This should be a block body
|
||||
@@ -0,0 +1,24 @@
|
||||
//// [asiPreventsParsingAsInterface05.ts]
|
||||
"use strict"
|
||||
|
||||
var interface: number;
|
||||
|
||||
// 'interface' is a strict mode reserved word, and so it would be permissible
|
||||
// to allow 'interface' and the name of the interface to be on separate lines;
|
||||
// however, this complicates things, and so it is preferable to restrict interface
|
||||
// declarations such that their identifier must follow 'interface' on the same line.
|
||||
|
||||
interface // This should be the identifier 'interface'
|
||||
I // This should be the identifier 'I'
|
||||
{ } // This should be a block body
|
||||
|
||||
//// [asiPreventsParsingAsInterface05.js]
|
||||
"use strict";
|
||||
var interface;
|
||||
// 'interface' is a strict mode reserved word, and so it would be permissible
|
||||
// to allow 'interface' and the name of the interface to be on separate lines;
|
||||
// however, this complicates things, and so it is preferable to restrict interface
|
||||
// declarations such that their identifier must follow 'interface' on the same line.
|
||||
interface; // This should be the identifier 'interface'
|
||||
I; // This should be the identifier 'I'
|
||||
{ } // This should be a block body
|
||||
@@ -0,0 +1,15 @@
|
||||
//// [asiPreventsParsingAsNamespace01.ts]
|
||||
|
||||
var namespace: number;
|
||||
var n: string;
|
||||
|
||||
namespace // this is the identifier 'namespace'
|
||||
n // this is the identifier 'n'
|
||||
{ } // this is a block body
|
||||
|
||||
//// [asiPreventsParsingAsNamespace01.js]
|
||||
var namespace;
|
||||
var n;
|
||||
namespace; // this is the identifier 'namespace'
|
||||
n; // this is the identifier 'n'
|
||||
{ } // this is a block body
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace01.ts ===
|
||||
|
||||
var namespace: number;
|
||||
>namespace : Symbol(namespace, Decl(asiPreventsParsingAsNamespace01.ts, 1, 3))
|
||||
|
||||
var n: string;
|
||||
>n : Symbol(n, Decl(asiPreventsParsingAsNamespace01.ts, 2, 3))
|
||||
|
||||
namespace // this is the identifier 'namespace'
|
||||
>namespace : Symbol(namespace, Decl(asiPreventsParsingAsNamespace01.ts, 1, 3))
|
||||
|
||||
n // this is the identifier 'n'
|
||||
>n : Symbol(n, Decl(asiPreventsParsingAsNamespace01.ts, 2, 3))
|
||||
|
||||
{ } // this is a block body
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace01.ts ===
|
||||
|
||||
var namespace: number;
|
||||
>namespace : number
|
||||
|
||||
var n: string;
|
||||
>n : string
|
||||
|
||||
namespace // this is the identifier 'namespace'
|
||||
>namespace : number
|
||||
|
||||
n // this is the identifier 'n'
|
||||
>n : string
|
||||
|
||||
{ } // this is a block body
|
||||
@@ -0,0 +1,15 @@
|
||||
//// [asiPreventsParsingAsNamespace02.ts]
|
||||
|
||||
var module: number;
|
||||
var m: string;
|
||||
|
||||
module // this is the identifier 'namespace'
|
||||
m // this is the identifier 'm'
|
||||
{ } // this is a block body
|
||||
|
||||
//// [asiPreventsParsingAsNamespace02.js]
|
||||
var module;
|
||||
var m;
|
||||
module; // this is the identifier 'namespace'
|
||||
m; // this is the identifier 'm'
|
||||
{ } // this is a block body
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace02.ts ===
|
||||
|
||||
var module: number;
|
||||
>module : Symbol(module, Decl(asiPreventsParsingAsNamespace02.ts, 1, 3))
|
||||
|
||||
var m: string;
|
||||
>m : Symbol(m, Decl(asiPreventsParsingAsNamespace02.ts, 2, 3))
|
||||
|
||||
module // this is the identifier 'namespace'
|
||||
>module : Symbol(module, Decl(asiPreventsParsingAsNamespace02.ts, 1, 3))
|
||||
|
||||
m // this is the identifier 'm'
|
||||
>m : Symbol(m, Decl(asiPreventsParsingAsNamespace02.ts, 2, 3))
|
||||
|
||||
{ } // this is a block body
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace02.ts ===
|
||||
|
||||
var module: number;
|
||||
>module : number
|
||||
|
||||
var m: string;
|
||||
>m : string
|
||||
|
||||
module // this is the identifier 'namespace'
|
||||
>module : number
|
||||
|
||||
m // this is the identifier 'm'
|
||||
>m : string
|
||||
|
||||
{ } // this is a block body
|
||||
@@ -0,0 +1,20 @@
|
||||
//// [asiPreventsParsingAsNamespace03.ts]
|
||||
|
||||
var namespace: number;
|
||||
var n: string;
|
||||
|
||||
namespace container {
|
||||
namespace // this is the identifier 'namespace'
|
||||
n // this is the identifier 'n'
|
||||
{ } // this is a block body
|
||||
}
|
||||
|
||||
//// [asiPreventsParsingAsNamespace03.js]
|
||||
var namespace;
|
||||
var n;
|
||||
var container;
|
||||
(function (container) {
|
||||
namespace; // this is the identifier 'namespace'
|
||||
n; // this is the identifier 'n'
|
||||
{ } // this is a block body
|
||||
})(container || (container = {}));
|
||||
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace03.ts ===
|
||||
|
||||
var namespace: number;
|
||||
>namespace : Symbol(namespace, Decl(asiPreventsParsingAsNamespace03.ts, 1, 3))
|
||||
|
||||
var n: string;
|
||||
>n : Symbol(n, Decl(asiPreventsParsingAsNamespace03.ts, 2, 3))
|
||||
|
||||
namespace container {
|
||||
>container : Symbol(container, Decl(asiPreventsParsingAsNamespace03.ts, 2, 14))
|
||||
|
||||
namespace // this is the identifier 'namespace'
|
||||
>namespace : Symbol(namespace, Decl(asiPreventsParsingAsNamespace03.ts, 1, 3))
|
||||
|
||||
n // this is the identifier 'n'
|
||||
>n : Symbol(n, Decl(asiPreventsParsingAsNamespace03.ts, 2, 3))
|
||||
|
||||
{ } // this is a block body
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace03.ts ===
|
||||
|
||||
var namespace: number;
|
||||
>namespace : number
|
||||
|
||||
var n: string;
|
||||
>n : string
|
||||
|
||||
namespace container {
|
||||
>container : typeof container
|
||||
|
||||
namespace // this is the identifier 'namespace'
|
||||
>namespace : number
|
||||
|
||||
n // this is the identifier 'n'
|
||||
>n : string
|
||||
|
||||
{ } // this is a block body
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
//// [asiPreventsParsingAsNamespace04.ts]
|
||||
|
||||
let module = 10;
|
||||
module in {}
|
||||
|
||||
//// [asiPreventsParsingAsNamespace04.js]
|
||||
var module = 10;
|
||||
module in {};
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace04.ts ===
|
||||
|
||||
let module = 10;
|
||||
>module : Symbol(module, Decl(asiPreventsParsingAsNamespace04.ts, 1, 3))
|
||||
|
||||
module in {}
|
||||
>module : Symbol(module, Decl(asiPreventsParsingAsNamespace04.ts, 1, 3))
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
=== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace04.ts ===
|
||||
|
||||
let module = 10;
|
||||
>module : number
|
||||
>10 : number
|
||||
|
||||
module in {}
|
||||
>module in {} : boolean
|
||||
>module : number
|
||||
>{} : {}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
//// [asiPreventsParsingAsNamespace05.ts]
|
||||
|
||||
let namespace = 10;
|
||||
namespace a.b {
|
||||
export let c = 20;
|
||||
}
|
||||
|
||||
namespace
|
||||
a.b.c
|
||||
{
|
||||
}
|
||||
|
||||
//// [asiPreventsParsingAsNamespace05.js]
|
||||
var namespace = 10;
|
||||
var a;
|
||||
(function (a) {
|
||||
var b;
|
||||
(function (b) {
|
||||
b.c = 20;
|
||||
})(b = a.b || (a.b = {}));
|
||||
})(a || (a = {}));
|
||||
namespace;
|
||||
a.b.c;
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
=== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace05.ts ===
|
||||
|
||||
let namespace = 10;
|
||||
>namespace : Symbol(namespace, Decl(asiPreventsParsingAsNamespace05.ts, 1, 3))
|
||||
|
||||
namespace a.b {
|
||||
>a : Symbol(a, Decl(asiPreventsParsingAsNamespace05.ts, 1, 19))
|
||||
>b : Symbol(b, Decl(asiPreventsParsingAsNamespace05.ts, 2, 12))
|
||||
|
||||
export let c = 20;
|
||||
>c : Symbol(c, Decl(asiPreventsParsingAsNamespace05.ts, 3, 14))
|
||||
}
|
||||
|
||||
namespace
|
||||
>namespace : Symbol(namespace, Decl(asiPreventsParsingAsNamespace05.ts, 1, 3))
|
||||
|
||||
a.b.c
|
||||
>a.b.c : Symbol(a.b.c, Decl(asiPreventsParsingAsNamespace05.ts, 3, 14))
|
||||
>a.b : Symbol(a.b, Decl(asiPreventsParsingAsNamespace05.ts, 2, 12))
|
||||
>a : Symbol(a, Decl(asiPreventsParsingAsNamespace05.ts, 1, 19))
|
||||
>b : Symbol(a.b, Decl(asiPreventsParsingAsNamespace05.ts, 2, 12))
|
||||
>c : Symbol(a.b.c, Decl(asiPreventsParsingAsNamespace05.ts, 3, 14))
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
=== tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace05.ts ===
|
||||
|
||||
let namespace = 10;
|
||||
>namespace : number
|
||||
>10 : number
|
||||
|
||||
namespace a.b {
|
||||
>a : typeof a
|
||||
>b : typeof b
|
||||
|
||||
export let c = 20;
|
||||
>c : number
|
||||
>20 : number
|
||||
}
|
||||
|
||||
namespace
|
||||
>namespace : number
|
||||
|
||||
a.b.c
|
||||
>a.b.c : number
|
||||
>a.b : typeof a.b
|
||||
>a : typeof a
|
||||
>b : typeof a.b
|
||||
>c : number
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
//// [asiPreventsParsingAsTypeAlias01.ts]
|
||||
|
||||
var type;
|
||||
var string;
|
||||
var Foo;
|
||||
|
||||
type
|
||||
Foo = string;
|
||||
|
||||
//// [asiPreventsParsingAsTypeAlias01.js]
|
||||
var type;
|
||||
var string;
|
||||
var Foo;
|
||||
type;
|
||||
Foo = string;
|
||||
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/conformance/types/typeAliases/asiPreventsParsingAsTypeAlias01.ts ===
|
||||
|
||||
var type;
|
||||
>type : Symbol(type, Decl(asiPreventsParsingAsTypeAlias01.ts, 1, 3))
|
||||
|
||||
var string;
|
||||
>string : Symbol(string, Decl(asiPreventsParsingAsTypeAlias01.ts, 2, 3))
|
||||
|
||||
var Foo;
|
||||
>Foo : Symbol(Foo, Decl(asiPreventsParsingAsTypeAlias01.ts, 3, 3))
|
||||
|
||||
type
|
||||
>type : Symbol(type, Decl(asiPreventsParsingAsTypeAlias01.ts, 1, 3))
|
||||
|
||||
Foo = string;
|
||||
>Foo : Symbol(Foo, Decl(asiPreventsParsingAsTypeAlias01.ts, 3, 3))
|
||||
>string : Symbol(string, Decl(asiPreventsParsingAsTypeAlias01.ts, 2, 3))
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/conformance/types/typeAliases/asiPreventsParsingAsTypeAlias01.ts ===
|
||||
|
||||
var type;
|
||||
>type : any
|
||||
|
||||
var string;
|
||||
>string : any
|
||||
|
||||
var Foo;
|
||||
>Foo : any
|
||||
|
||||
type
|
||||
>type : any
|
||||
|
||||
Foo = string;
|
||||
>Foo = string : any
|
||||
>Foo : any
|
||||
>string : any
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
//// [asiPreventsParsingAsTypeAlias02.ts]
|
||||
|
||||
var type;
|
||||
var string;
|
||||
var Foo;
|
||||
|
||||
namespace container {
|
||||
type
|
||||
Foo = string;
|
||||
}
|
||||
|
||||
//// [asiPreventsParsingAsTypeAlias02.js]
|
||||
var type;
|
||||
var string;
|
||||
var Foo;
|
||||
var container;
|
||||
(function (container) {
|
||||
type;
|
||||
Foo = string;
|
||||
})(container || (container = {}));
|
||||
@@ -0,0 +1,21 @@
|
||||
=== tests/cases/conformance/types/typeAliases/asiPreventsParsingAsTypeAlias02.ts ===
|
||||
|
||||
var type;
|
||||
>type : Symbol(type, Decl(asiPreventsParsingAsTypeAlias02.ts, 1, 3))
|
||||
|
||||
var string;
|
||||
>string : Symbol(string, Decl(asiPreventsParsingAsTypeAlias02.ts, 2, 3))
|
||||
|
||||
var Foo;
|
||||
>Foo : Symbol(Foo, Decl(asiPreventsParsingAsTypeAlias02.ts, 3, 3))
|
||||
|
||||
namespace container {
|
||||
>container : Symbol(container, Decl(asiPreventsParsingAsTypeAlias02.ts, 3, 8))
|
||||
|
||||
type
|
||||
>type : Symbol(type, Decl(asiPreventsParsingAsTypeAlias02.ts, 1, 3))
|
||||
|
||||
Foo = string;
|
||||
>Foo : Symbol(Foo, Decl(asiPreventsParsingAsTypeAlias02.ts, 3, 3))
|
||||
>string : Symbol(string, Decl(asiPreventsParsingAsTypeAlias02.ts, 2, 3))
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/conformance/types/typeAliases/asiPreventsParsingAsTypeAlias02.ts ===
|
||||
|
||||
var type;
|
||||
>type : any
|
||||
|
||||
var string;
|
||||
>string : any
|
||||
|
||||
var Foo;
|
||||
>Foo : any
|
||||
|
||||
namespace container {
|
||||
>container : typeof container
|
||||
|
||||
type
|
||||
>type : any
|
||||
|
||||
Foo = string;
|
||||
>Foo = string : any
|
||||
>Foo : any
|
||||
>string : any
|
||||
}
|
||||
@@ -104,8 +104,7 @@ b18 = a18; // ok
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Base = (function () {
|
||||
function Base() {
|
||||
|
||||
@@ -103,8 +103,7 @@ module Errors {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Errors;
|
||||
(function (Errors) {
|
||||
|
||||
@@ -70,8 +70,7 @@ b18 = a18; // ok
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Base = (function () {
|
||||
function Base() {
|
||||
|
||||
@@ -47,8 +47,7 @@ b16 = x.a16;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Base = (function () {
|
||||
function Base() {
|
||||
|
||||
@@ -104,8 +104,7 @@ b18 = a18; // ok
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Base = (function () {
|
||||
function Base() {
|
||||
|
||||
@@ -103,8 +103,7 @@ module Errors {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Errors;
|
||||
(function (Errors) {
|
||||
|
||||
@@ -70,8 +70,7 @@ b18 = a18; // ok
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Base = (function () {
|
||||
function Base() {
|
||||
|
||||
@@ -47,8 +47,7 @@ b16 = x.a16;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Base = (function () {
|
||||
function Base() {
|
||||
|
||||
@@ -48,8 +48,7 @@ module Generics {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var A = (function () {
|
||||
function A() {
|
||||
|
||||
@@ -45,8 +45,7 @@ module Generics {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var A = (function () {
|
||||
function A() {
|
||||
|
||||
@@ -96,8 +96,7 @@ module WithBase {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var OnlyDerived;
|
||||
(function (OnlyDerived) {
|
||||
|
||||
@@ -93,8 +93,7 @@ module SourceHasOptional {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Base = (function () {
|
||||
function Base() {
|
||||
|
||||
@@ -95,8 +95,7 @@ module SourceHasOptional {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var Base = (function () {
|
||||
function Base() {
|
||||
|
||||
@@ -58,8 +58,7 @@ module Generics {
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var A = (function () {
|
||||
function A() {
|
||||
|
||||
@@ -74,8 +74,7 @@ foo() = value;
|
||||
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; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
// expected error for all the LHS of assignments
|
||||
var value;
|
||||
|
||||
Loaded 100 of 1033 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user