mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Merge branch 'master' into testPerf
This commit is contained in:
commit
31ea4ba666
397 files changed
+6555
-4548
No files matched your search
-1
@@ -16,6 +16,5 @@ var A;
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
A.beez;
|
||||
A.beez2 = new Array();
|
||||
})(A || (A = {}));
|
||||
@@ -0,0 +1,47 @@
|
||||
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(3,8): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(4,5): error TS2304: Cannot find name 'let'.
|
||||
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(5,10): error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts (3 errors) ====
|
||||
|
||||
module Inner {
|
||||
var;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
let;
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
const;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
//// [NonInitializedExportInInternalModule.ts]
|
||||
|
||||
module Inner {
|
||||
var;
|
||||
let;
|
||||
const;
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
}
|
||||
|
||||
//// [NonInitializedExportInInternalModule.js]
|
||||
var Inner;
|
||||
(function (Inner) {
|
||||
var ;
|
||||
let;
|
||||
var ;
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
var B;
|
||||
(function (B) {
|
||||
B.a = 1, B.c = 2;
|
||||
})(B || (B = {}));
|
||||
var C;
|
||||
(function (C) {
|
||||
C.a = 1, C.c = 2;
|
||||
})(C || (C = {}));
|
||||
// Shouldn't be filtered
|
||||
Inner.a1 = 1;
|
||||
Inner.b1 = 1;
|
||||
Inner.c1 = 'a';
|
||||
Inner.d1 = 1;
|
||||
var D = (function () {
|
||||
function D() {
|
||||
}
|
||||
return D;
|
||||
})();
|
||||
Inner.e1 = new D;
|
||||
Inner.f1 = new D;
|
||||
Inner.g1 = new D;
|
||||
Inner.h1 = new D;
|
||||
})(Inner || (Inner = {}));
|
||||
-2
@@ -39,14 +39,12 @@ var A;
|
||||
(function (A) {
|
||||
var B;
|
||||
(function (B) {
|
||||
B.x;
|
||||
})(B = A.B || (A.B = {}));
|
||||
})(A || (A = {}));
|
||||
var A;
|
||||
(function (A) {
|
||||
var B;
|
||||
(function (B) {
|
||||
B.x;
|
||||
})(B || (B = {}));
|
||||
})(A || (A = {}));
|
||||
// ensure the right var decl is exported
|
||||
|
||||
@@ -55,7 +55,6 @@ var E;
|
||||
})(E || (E = {}));
|
||||
var M;
|
||||
(function (M) {
|
||||
M.a;
|
||||
})(M || (M = {}));
|
||||
var a;
|
||||
var b;
|
||||
|
||||
@@ -56,7 +56,6 @@ var E;
|
||||
})(E || (E = {}));
|
||||
var M;
|
||||
(function (M) {
|
||||
M.a;
|
||||
})(M || (M = {}));
|
||||
var a;
|
||||
var b;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/compiler/aliasErrors.ts(11,12): error TS2304: Cannot find name 'no'.
|
||||
tests/cases/compiler/aliasErrors.ts(12,13): error TS2304: Cannot find name 'no'.
|
||||
tests/cases/compiler/aliasErrors.ts(11,12): error TS2503: Cannot find namespace 'no'.
|
||||
tests/cases/compiler/aliasErrors.ts(12,13): error TS2503: Cannot find namespace 'no'.
|
||||
tests/cases/compiler/aliasErrors.ts(13,12): error TS1003: Identifier expected.
|
||||
tests/cases/compiler/aliasErrors.ts(14,12): error TS1003: Identifier expected.
|
||||
tests/cases/compiler/aliasErrors.ts(15,12): error TS1003: Identifier expected.
|
||||
tests/cases/compiler/aliasErrors.ts(16,12): error TS2304: Cannot find name 'undefined'.
|
||||
tests/cases/compiler/aliasErrors.ts(16,12): error TS2503: Cannot find namespace 'undefined'.
|
||||
tests/cases/compiler/aliasErrors.ts(26,15): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'.
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ tests/cases/compiler/aliasErrors.ts(26,15): error TS2305: Module 'foo.bar.baz' h
|
||||
|
||||
import m = no;
|
||||
~~
|
||||
!!! error TS2304: Cannot find name 'no'.
|
||||
!!! error TS2503: Cannot find namespace 'no'.
|
||||
import m2 = no.mod;
|
||||
~~
|
||||
!!! error TS2304: Cannot find name 'no'.
|
||||
!!! error TS2503: Cannot find namespace 'no'.
|
||||
import n = 5;
|
||||
~
|
||||
!!! error TS1003: Identifier expected.
|
||||
@@ -35,7 +35,7 @@ tests/cases/compiler/aliasErrors.ts(26,15): error TS2305: Module 'foo.bar.baz' h
|
||||
!!! error TS1003: Identifier expected.
|
||||
import r = undefined;
|
||||
~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'undefined'.
|
||||
!!! error TS2503: Cannot find namespace 'undefined'.
|
||||
|
||||
|
||||
var p = new provide.Provide();
|
||||
|
||||
@@ -19,7 +19,6 @@ export var a = function () {
|
||||
|
||||
|
||||
//// [aliasUsedAsNameValue_0.js]
|
||||
exports.id;
|
||||
//// [aliasUsedAsNameValue_1.js]
|
||||
function b(a) { return null; }
|
||||
exports.b = b;
|
||||
|
||||
@@ -26,7 +26,7 @@ function f2() {
|
||||
//// [arrayLiteralSpread.js]
|
||||
function f0() {
|
||||
var a = [1, 2, 3];
|
||||
var a1 = a;
|
||||
var a1 = a.slice();
|
||||
var a2 = [1].concat(a);
|
||||
var a3 = [1, 2].concat(a);
|
||||
var a4 = a.concat([1]);
|
||||
|
||||
@@ -93,12 +93,12 @@ var temp2 = [[1, 2, 3], ["hello", "string"]];
|
||||
var temp3 = [undefined, null, undefined];
|
||||
var temp4 = [];
|
||||
var d0 = [1, true].concat(temp); // has type (string|number|boolean)[]
|
||||
var d1 = temp; // has type string[]
|
||||
var d2 = temp1;
|
||||
var d3 = temp1;
|
||||
var d1 = temp.slice(); // has type string[]
|
||||
var d2 = temp1.slice();
|
||||
var d3 = temp1.slice();
|
||||
var d4 = temp.concat(temp1);
|
||||
var d5 = temp3;
|
||||
var d6 = temp4;
|
||||
var d7 = temp1;
|
||||
var d8 = [temp1];
|
||||
var d9 = [temp1].concat(["hello"]);
|
||||
var d5 = temp3.slice();
|
||||
var d6 = temp4.slice();
|
||||
var d7 = temp1.slice();
|
||||
var d8 = [temp1.slice()];
|
||||
var d9 = [temp1.slice()].concat(["hello"]);
|
||||
@@ -55,6 +55,6 @@ var _a = [1, 2, "string", true], b1 = _a[0], b2 = _a[1];
|
||||
var temp = ["s", "t", "r"];
|
||||
var temp1 = [1, 2, 3];
|
||||
var temp2 = [[1, 2, 3], ["hello", "string"]];
|
||||
var c0 = temp2; // Error
|
||||
var c1 = temp1; // Error cannot assign number[] to [number, number, number]
|
||||
var c0 = temp2.slice(); // Error
|
||||
var c1 = temp1.slice(); // Error cannot assign number[] to [number, number, number]
|
||||
var c2 = temp1.concat(temp); // Error cannot assign (number|string)[] to number[]
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.obj;
|
||||
__test2__.__val__obj = __test2__.obj;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
__test2__.__val__obj = __test1__.__val__obj4;
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.obj;
|
||||
__test2__.__val__obj = __test2__.obj;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
__test2__.__val__obj = __test1__.__val__obj4;
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -93,7 +93,6 @@ this = value;
|
||||
// identifiers: module, class, enum, function
|
||||
var M;
|
||||
(function (M) {
|
||||
M.a;
|
||||
})(M || (M = {}));
|
||||
M = value;
|
||||
C = value;
|
||||
|
||||
@@ -79,7 +79,6 @@ x = ''; // Error
|
||||
(x) = ''; // Error
|
||||
var M;
|
||||
(function (M) {
|
||||
M.y;
|
||||
})(M || (M = {}));
|
||||
M.y = 3; // OK
|
||||
(M).y = 3; // OK
|
||||
@@ -93,7 +92,6 @@ var M2;
|
||||
(function (M2) {
|
||||
var M3;
|
||||
(function (M3) {
|
||||
M3.x;
|
||||
})(M3 = M2.M3 || (M2.M3 = {}));
|
||||
M3 = { x: 3 }; // Error
|
||||
})(M2 || (M2 = {}));
|
||||
|
||||
@@ -84,7 +84,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// any other type var
|
||||
|
||||
@@ -50,7 +50,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// boolean type var
|
||||
|
||||
@@ -57,7 +57,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// number type var
|
||||
|
||||
@@ -56,7 +56,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// string type var
|
||||
|
||||
-1
@@ -27,7 +27,6 @@ var A = (function () {
|
||||
})();
|
||||
var A;
|
||||
(function (A) {
|
||||
A.v;
|
||||
})(A || (A = {}));
|
||||
var Foo;
|
||||
(function (Foo) {
|
||||
|
||||
@@ -16,7 +16,6 @@ export class Test1 {
|
||||
}
|
||||
|
||||
//// [classMemberInitializerWithLamdaScoping3_0.js]
|
||||
exports.field1;
|
||||
//// [classMemberInitializerWithLamdaScoping3_1.js]
|
||||
var Test1 = (function () {
|
||||
function Test1(field1) {
|
||||
|
||||
@@ -6,5 +6,4 @@ export var b: number;
|
||||
//// [commentsBeforeVariableStatement1.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
/** b's comment*/
|
||||
exports.b;
|
||||
});
|
||||
@@ -67,7 +67,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
var m1;
|
||||
(function (m1) {
|
||||
/** b's comment*/
|
||||
m1.b;
|
||||
/** foo's comment*/
|
||||
function foo() {
|
||||
return m1.b;
|
||||
@@ -98,7 +97,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
var m4;
|
||||
(function (m4) {
|
||||
/** b's comment */
|
||||
m4.b;
|
||||
/** foo's comment
|
||||
*/
|
||||
function foo() {
|
||||
|
||||
@@ -67,7 +67,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
var m1;
|
||||
(function (m1) {
|
||||
/** b's comment*/
|
||||
m1.b;
|
||||
/** foo's comment*/
|
||||
function foo() {
|
||||
return m1.b;
|
||||
@@ -98,7 +97,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
var m4;
|
||||
(function (m4) {
|
||||
/** b's comment */
|
||||
m4.b;
|
||||
/** foo's comment
|
||||
*/
|
||||
function foo() {
|
||||
|
||||
@@ -66,7 +66,6 @@ export var newVar2 = new extMod.m4.m2.c();
|
||||
var m1;
|
||||
(function (m1) {
|
||||
/** b's comment*/
|
||||
m1.b;
|
||||
/** foo's comment*/
|
||||
function foo() {
|
||||
return m1.b;
|
||||
@@ -97,7 +96,6 @@ var myvar = new m1.m2.c();
|
||||
var m4;
|
||||
(function (m4) {
|
||||
/** b's comment */
|
||||
m4.b;
|
||||
/** foo's comment
|
||||
*/
|
||||
function foo() {
|
||||
|
||||
@@ -102,7 +102,6 @@ new m7.m8.m9.c();
|
||||
var m1;
|
||||
(function (m1) {
|
||||
/** b's comment*/
|
||||
m1.b;
|
||||
/** foo's comment*/
|
||||
function foo() {
|
||||
return m1.b;
|
||||
|
||||
@@ -163,7 +163,6 @@ var m1;
|
||||
return C5;
|
||||
})();
|
||||
m1.C5 = C5;
|
||||
m1.v2;
|
||||
})(m1 || (m1 = {}));
|
||||
var C2 = (function () {
|
||||
function C2() {
|
||||
|
||||
@@ -156,7 +156,6 @@ this += value;
|
||||
// identifiers: module, class, enum, function
|
||||
var M;
|
||||
(function (M) {
|
||||
M.a;
|
||||
})(M || (M = {}));
|
||||
M *= value;
|
||||
M += value;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2304: Cannot find name 'module'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2503: Cannot find namespace 'module'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -82,7 +83,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error T
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (82 errors) ====
|
||||
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (83 errors) ====
|
||||
declare module "fs" {
|
||||
export class File {
|
||||
constructor(filename: string);
|
||||
@@ -96,6 +97,8 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS
|
||||
import fs = module("fs");
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'module'.
|
||||
~~~~~~
|
||||
!!! error TS2503: Cannot find namespace 'module'.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
|
||||
|
||||
@@ -283,7 +283,6 @@ var C4T5 = (function () {
|
||||
// CONTEXT: Module property assignment
|
||||
var C5T5;
|
||||
(function (C5T5) {
|
||||
C5T5.foo;
|
||||
C5T5.foo = function (i, s) {
|
||||
return s;
|
||||
};
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [contextualTyping.js.map]
|
||||
{"version":3,"file":"contextualTyping.js","sourceRoot":"","sources":["contextualTyping.ts"],"names":["C1T5","C1T5.constructor","C2T5","C4T5","C4T5.constructor","C5T5","c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EAAE,CAAC,CAAC,CAAC;AAC9C,IAAI,MAAM,GAAyC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,IAAI,MAAM,GAAU;IAChB,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAOF,aAAa,CAAC,EAAC,CAAC,IAAIE,MAAMA,CAACA,CAACA,GAACA,CAACA,CAACA,CAACA,CAACA;AAEjC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;AAcnB,eAAe,CAAC,EAAE,CAAC;IACfC,IAAIA,CAACA,CAACA,GAAGA,CAACA,CAACA;IACXA,IAAIA,CAACA,CAACA,GAAGA,CAACA,CAACA;IAEXA,MLine truncated
|
||||
{"version":3,"file":"contextualTyping.js","sourceRoot":"","sources":["contextualTyping.ts"],"names":["C1T5","C1T5.constructor","C2T5","C4T5","C4T5.constructor","C5T5","c9t5","C11t5","C11t5.constructor","EF1","Point"],"mappings":"AAaA,AADA,sCAAsC;;IACtCA;QACIC,QAAGA,GAAqCA,UAASA,CAACA;YAC9C,MAAM,CAAC,CAAC,CAAC;QACb,CAAC,CAAAA;IACLA,CAACA;IAADD,WAACA;AAADA,CAACA,AAJD,IAIC;AAGD,AADA,uCAAuC;AACvC,IAAO,IAAI,CAIV;AAJD,WAAO,IAAI,EAAC,CAAC;IACEE,QAAGA,GAAqCA,UAASA,CAACA;QACzD,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,CAAAA;AACLA,CAACA,EAJM,IAAI,KAAJ,IAAI,QAIV;AAGD,AADA,gCAAgC;IAC5B,I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,MAAMA,CAACA,CAACA,GAACA,CAACA,CAACA,CAACA,CAACA;AAEjC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;AAcnB,eAAe,CAAC,EAAE,CAAC;IACfC,IAAIA,CAACA,CAACA,GAAGA,CAACA,CAACA;IACXA,IAAIA,CAACA,CAACA,GAAGA,CAACA,CAACA;IAEXA,MAAMA,CAACA,IAAIA,CAALine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -2,4 +2,4 @@
|
||||
var foo: {id:number;} = {id:4};
|
||||
|
||||
//// [contextualTyping1.js]
|
||||
var foo = { id: 4 };\n
|
||||
var foo = { id: 4 };
|
||||
@@ -20,7 +20,6 @@ export var x: SubModule.m.m3.c;
|
||||
|
||||
//// [declFileAmbientExternalModuleWithSingleExportedModule_0.js]
|
||||
//// [declFileAmbientExternalModuleWithSingleExportedModule_1.js]
|
||||
exports.x;
|
||||
|
||||
|
||||
//// [declFileAmbientExternalModuleWithSingleExportedModule_0.d.ts]
|
||||
|
||||
@@ -24,7 +24,6 @@ export = m;
|
||||
//// [declFileExportAssignmentImportInternalModule.js]
|
||||
var m3;
|
||||
(function (m3) {
|
||||
m3.server;
|
||||
})(m3 || (m3 = {}));
|
||||
var m = m3;
|
||||
module.exports = m;
|
||||
|
||||
@@ -17,7 +17,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
});
|
||||
//// [declFileExportAssignmentOfGenericInterface_1.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
exports.x;
|
||||
exports.x.a;
|
||||
});
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ define(["require", "exports", "declFileExportImportChain_b1"], function (require
|
||||
});
|
||||
//// [declFileExportImportChain_d.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
exports.x;
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ define(["require", "exports", "declFileExportImportChain2_b"], function (require
|
||||
});
|
||||
//// [declFileExportImportChain2_d.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
exports.x;
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ export import b = a;
|
||||
var z = b.x;
|
||||
|
||||
//// [declFileForExportedImport_0.js]
|
||||
exports.x;
|
||||
//// [declFileForExportedImport_1.js]
|
||||
///<reference path='declFileForExportedImport_0.ts'/>
|
||||
exports.a = require('declFileForExportedImport_0');
|
||||
|
||||
@@ -80,7 +80,6 @@ var C;
|
||||
})();
|
||||
C.D = D;
|
||||
})(C = exports.C || (exports.C = {}));
|
||||
exports.a;
|
||||
exports.b = C.F;
|
||||
exports.c = C.F2;
|
||||
exports.d = C.F3;
|
||||
|
||||
@@ -34,7 +34,6 @@ module M {
|
||||
//// [declFileTypeAnnotationTypeAlias.js]
|
||||
var M;
|
||||
(function (M) {
|
||||
M.x;
|
||||
var c = (function () {
|
||||
function c() {
|
||||
}
|
||||
@@ -61,7 +60,6 @@ var M;
|
||||
return Window;
|
||||
})();
|
||||
N.Window = Window;
|
||||
N.p;
|
||||
})(N = M.N || (M.N = {}));
|
||||
})(M || (M = {}));
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ var M;
|
||||
return Window;
|
||||
})();
|
||||
N.Window = Window;
|
||||
N.p; // Should report error that W is private
|
||||
// Should report error that W is private
|
||||
})(N = M.N || (M.N = {}));
|
||||
})(M || (M = {}));
|
||||
var M1;
|
||||
@@ -65,7 +65,7 @@ var M1;
|
||||
return Window;
|
||||
})();
|
||||
N.Window = Window;
|
||||
N.p; // No error
|
||||
// No error
|
||||
})(N = M1.N || (M1.N = {}));
|
||||
})(M1 || (M1 = {}));
|
||||
var M2;
|
||||
|
||||
@@ -51,7 +51,6 @@ var m;
|
||||
})();
|
||||
m2.public1 = public1;
|
||||
})(m2 || (m2 = {}));
|
||||
m.x;
|
||||
m.x2 = {
|
||||
x: new private1(),
|
||||
y: new m2.public1(),
|
||||
@@ -61,9 +60,7 @@ var m;
|
||||
};
|
||||
m.x3 = m.x;
|
||||
// Function type
|
||||
m.y;
|
||||
m.y2 = m.y;
|
||||
// constructor type
|
||||
m.z;
|
||||
m.z2 = m.z;
|
||||
})(m || (m = {}));
|
||||
@@ -50,11 +50,9 @@ var m;
|
||||
// Directly using names from this module
|
||||
var x;
|
||||
var y = new private1();
|
||||
m.k;
|
||||
m.l = new private1();
|
||||
var x2;
|
||||
var y2 = new public1();
|
||||
m.k2;
|
||||
m.l2 = new public1();
|
||||
var m2;
|
||||
(function (m2) {
|
||||
@@ -67,6 +65,5 @@ var m;
|
||||
})(m2 || (m2 = {}));
|
||||
var x3;
|
||||
var y3 = new m2.public2();
|
||||
m.k3;
|
||||
m.l3 = new m2.public2();
|
||||
})(m || (m = {}));
|
||||
@@ -16,13 +16,11 @@ var m2_2: typeof m2;
|
||||
//// [declFileTypeofModule.js]
|
||||
var m1;
|
||||
(function (m1) {
|
||||
m1.c;
|
||||
})(m1 || (m1 = {}));
|
||||
var m1_1 = m1;
|
||||
var m1_2;
|
||||
var m2;
|
||||
(function (m2) {
|
||||
m2.d;
|
||||
})(m2 || (m2 = {}));
|
||||
var m2_1 = m2;
|
||||
var m2_2;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
tests/cases/compiler/declarationEmitDestructuring2.ts(3,13): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/declarationEmitDestructuring2.ts(3,17): error TS2300: Duplicate identifier 'b'.
|
||||
tests/cases/compiler/declarationEmitDestructuring2.ts(3,23): error TS2300: Duplicate identifier 'c'.
|
||||
tests/cases/compiler/declarationEmitDestructuring2.ts(3,41): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/declarationEmitDestructuring2.ts(3,44): error TS2300: Duplicate identifier 'b'.
|
||||
tests/cases/compiler/declarationEmitDestructuring2.ts(3,47): error TS2300: Duplicate identifier 'c'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/declarationEmitDestructuring2.ts (6 errors) ====
|
||||
function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { }
|
||||
function g([a, b, c, d] = [1, 2, 3, 4]) { }
|
||||
function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'b'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'c'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'b'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'c'.
|
||||
function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ }
|
||||
@@ -1,40 +0,0 @@
|
||||
=== tests/cases/compiler/declarationEmitDestructuring2.ts ===
|
||||
function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { }
|
||||
>f : Symbol(f, Decl(declarationEmitDestructuring2.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(declarationEmitDestructuring2.ts, 0, 12))
|
||||
>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 0, 24))
|
||||
>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 0, 26))
|
||||
>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 0, 29))
|
||||
>d : Symbol(d, Decl(declarationEmitDestructuring2.ts, 0, 32))
|
||||
>x : Symbol(x, Decl(declarationEmitDestructuring2.ts, 0, 55))
|
||||
>y : Symbol(y, Decl(declarationEmitDestructuring2.ts, 0, 62))
|
||||
|
||||
function g([a, b, c, d] = [1, 2, 3, 4]) { }
|
||||
>g : Symbol(g, Decl(declarationEmitDestructuring2.ts, 0, 85))
|
||||
>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 1, 12))
|
||||
>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 1, 14))
|
||||
>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 1, 17))
|
||||
>d : Symbol(d, Decl(declarationEmitDestructuring2.ts, 1, 20))
|
||||
|
||||
function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ }
|
||||
>h : Symbol(h, Decl(declarationEmitDestructuring2.ts, 1, 43))
|
||||
>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 2, 12), Decl(declarationEmitDestructuring2.ts, 2, 40))
|
||||
>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 2, 16), Decl(declarationEmitDestructuring2.ts, 2, 42))
|
||||
>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 2, 22), Decl(declarationEmitDestructuring2.ts, 2, 45))
|
||||
>x : Symbol(x, Decl(declarationEmitDestructuring2.ts, 2, 28))
|
||||
>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 2, 12), Decl(declarationEmitDestructuring2.ts, 2, 40))
|
||||
>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 2, 16), Decl(declarationEmitDestructuring2.ts, 2, 42))
|
||||
>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 2, 22), Decl(declarationEmitDestructuring2.ts, 2, 45))
|
||||
>a1 : Symbol(a1, Decl(declarationEmitDestructuring2.ts, 2, 54))
|
||||
>b1 : Symbol(b1, Decl(declarationEmitDestructuring2.ts, 2, 57))
|
||||
|
||||
function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ }
|
||||
>h1 : Symbol(h1, Decl(declarationEmitDestructuring2.ts, 2, 67))
|
||||
>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 3, 13))
|
||||
>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 3, 17))
|
||||
>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 3, 23))
|
||||
>x : Symbol(x, Decl(declarationEmitDestructuring2.ts, 3, 29))
|
||||
>y : Symbol(y, Decl(declarationEmitDestructuring2.ts, 3, 36))
|
||||
>a1 : Symbol(a1, Decl(declarationEmitDestructuring2.ts, 3, 56))
|
||||
>b1 : Symbol(b1, Decl(declarationEmitDestructuring2.ts, 3, 59))
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
=== tests/cases/compiler/declarationEmitDestructuring2.ts ===
|
||||
function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { }
|
||||
>f : ({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]}?: { x: number; y: [number, number, number, number]; }) => void
|
||||
>x : number
|
||||
>10 : number
|
||||
>y : any
|
||||
>a : number
|
||||
>b : number
|
||||
>c : number
|
||||
>d : number
|
||||
>[1, 2, 3, 4] : [number, number, number, number]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>3 : number
|
||||
>4 : number
|
||||
>{ x: 10, y: [2, 4, 6, 8] } : { x: number; y: [number, number, number, number]; }
|
||||
>x : number
|
||||
>10 : number
|
||||
>y : [number, number, number, number]
|
||||
>[2, 4, 6, 8] : [number, number, number, number]
|
||||
>2 : number
|
||||
>4 : number
|
||||
>6 : number
|
||||
>8 : number
|
||||
|
||||
function g([a, b, c, d] = [1, 2, 3, 4]) { }
|
||||
>g : ([a, b, c, d]?: [number, number, number, number]) => void
|
||||
>a : number
|
||||
>b : number
|
||||
>c : number
|
||||
>d : number
|
||||
>[1, 2, 3, 4] : [number, number, number, number]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>3 : number
|
||||
>4 : number
|
||||
|
||||
function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ }
|
||||
>h : ([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]: [any, [any], [[any]], { x?: number; y: [any, any, any]; z: { a1: any; b1: any; }; }]) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
>x : number
|
||||
>10 : number
|
||||
>y : any
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
>z : any
|
||||
>a1 : any
|
||||
>b1 : any
|
||||
|
||||
function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ }
|
||||
>h1 : ([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]: [any, [any], [[any]], { x?: number; y?: number[]; z: { a1: any; b1: any; }; }]) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
>x : number
|
||||
>10 : number
|
||||
>y : number[]
|
||||
>[1, 2, 3] : number[]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>3 : number
|
||||
>z : any
|
||||
>a1 : any
|
||||
>b1 : any
|
||||
|
||||
@@ -22,7 +22,6 @@ var m;
|
||||
})();
|
||||
c_1.c = c;
|
||||
})(c = m.c || (m.c = {}));
|
||||
m.a;
|
||||
})(m || (m = {}));
|
||||
module.exports = m;
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ var X;
|
||||
base.C = C;
|
||||
var M;
|
||||
(function (M) {
|
||||
M.v;
|
||||
})(M = base.M || (base.M = {}));
|
||||
(function (E) {
|
||||
})(base.E || (base.E = {}));
|
||||
|
||||
@@ -74,7 +74,7 @@ var M;
|
||||
D[D["f"] = 0] = "f";
|
||||
})(P.D || (P.D = {}));
|
||||
var D = P.D;
|
||||
P.v; // ok
|
||||
// ok
|
||||
P.w = M.D.f; // error, should be typeof M.D.f
|
||||
P.x = M.C.f; // error, should be typeof M.C.f
|
||||
P.x = M.E.f; // error, should be typeof M.E.f
|
||||
|
||||
@@ -9,7 +9,7 @@ export module M {
|
||||
//// [declarationEmit_nameConflictsWithAlias.js]
|
||||
var M;
|
||||
(function (M) {
|
||||
M.w; // Gets emitted as C.I, which is the wrong interface
|
||||
// Gets emitted as C.I, which is the wrong interface
|
||||
})(M = exports.M || (exports.M = {}));
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/declareModifierOnImport1.ts(1,1): error TS1079: A 'declare' modifier cannot be used with an import declaration.
|
||||
tests/cases/compiler/declareModifierOnImport1.ts(1,20): error TS2304: Cannot find name 'b'.
|
||||
tests/cases/compiler/declareModifierOnImport1.ts(1,20): error TS2503: Cannot find namespace 'b'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/declareModifierOnImport1.ts (2 errors) ====
|
||||
@@ -7,4 +7,4 @@ tests/cases/compiler/declareModifierOnImport1.ts(1,20): error TS2304: Cannot fin
|
||||
~~~~~~~
|
||||
!!! error TS1079: A 'declare' modifier cannot be used with an import declaration.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'b'.
|
||||
!!! error TS2503: Cannot find namespace 'b'.
|
||||
@@ -21,7 +21,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
function decorate() { }
|
||||
let Decorated = class {
|
||||
};
|
||||
Object.defineProperty(Decorated, "name", { value: "Decorated", configurable: true });
|
||||
Decorated = __decorate([
|
||||
decorate
|
||||
], Decorated);
|
||||
|
||||
@@ -13,5 +13,4 @@ module M2 {
|
||||
//// [decoratorOnImportEquals1.js]
|
||||
var M1;
|
||||
(function (M1) {
|
||||
M1.X;
|
||||
})(M1 || (M1 = {}));
|
||||
@@ -10,5 +10,4 @@ import lib = require('./decoratorOnImportEquals2_0');
|
||||
declare function dec<T>(target: T): T;
|
||||
|
||||
//// [decoratorOnImportEquals2_0.js]
|
||||
exports.X;
|
||||
//// [decoratorOnImportEquals2_1.js]
|
||||
@@ -61,7 +61,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// any type var
|
||||
|
||||
@@ -93,7 +93,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// any type var
|
||||
|
||||
@@ -50,7 +50,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// number type var
|
||||
|
||||
@@ -59,7 +59,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
//number type var
|
||||
|
||||
@@ -66,7 +66,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// boolean type var
|
||||
|
||||
@@ -78,7 +78,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// string type var
|
||||
|
||||
@@ -62,7 +62,6 @@ var f5 = function (a) {
|
||||
};
|
||||
var U;
|
||||
(function (U) {
|
||||
U.x;
|
||||
})(U || (U = {}));
|
||||
var f6 = function (t) {
|
||||
if (t === void 0) { t = T; }
|
||||
|
||||
@@ -83,7 +83,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// any type var
|
||||
|
||||
@@ -50,7 +50,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// boolean type var
|
||||
|
||||
@@ -58,7 +58,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// number type var
|
||||
|
||||
@@ -57,7 +57,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// string type var
|
||||
|
||||
@@ -88,7 +88,7 @@ var _e = foo(), b6 = _e[0], b7 = _e[1];
|
||||
var b8 = foo().slice(0);
|
||||
// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E.
|
||||
var temp = [1, 2, 3];
|
||||
var _f = temp, c0 = _f[0], c1 = _f[1];
|
||||
var _f = temp.slice(), c0 = _f[0], c1 = _f[1];
|
||||
var c2 = [][0];
|
||||
var _g = [[[]], [[[[]]]]], c3 = _g[0][0][0], c4 = _g[1][0][0][0][0];
|
||||
var _h = [[1], true], c5 = _h[0][0], c6 = _h[1];
|
||||
|
||||
@@ -50,8 +50,8 @@ var _c = bar(), _d = _c[0], b3 = _d === void 0 ? "string" : _d, b4 = _c[1], b5 =
|
||||
// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V,
|
||||
// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E.
|
||||
var temp = [1, 2, 3];
|
||||
var _e = temp, c0 = _e[0], c1 = _e[1]; // Error
|
||||
var _f = temp, c2 = _f[0], c3 = _f[1]; // Error
|
||||
var _e = temp.slice(), c0 = _e[0], c1 = _e[1]; // Error
|
||||
var _f = temp.slice(), c2 = _f[0], c3 = _f[1]; // Error
|
||||
function foo(idx) {
|
||||
return {
|
||||
2: true
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts(96,18): error TS2300: Duplicate identifier 'number'.
|
||||
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts(96,26): error TS2300: Duplicate identifier 'number'.
|
||||
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts(96,34): error TS2300: Duplicate identifier 'number'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts (3 errors) ====
|
||||
// Conformance for emitting ES6
|
||||
|
||||
// A parameter declaration may specify either an identifier or a binding pattern.
|
||||
// The identifiers specified in parameter declarations and binding patterns
|
||||
// in a parameter list must be unique within that parameter list.
|
||||
|
||||
// If the declaration includes a type annotation, the parameter is of that type
|
||||
function a1([a, b, [[c]]]: [number, number, string[][]]) { }
|
||||
function a2(o: { x: number, a: number }) { }
|
||||
function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { };
|
||||
function a4({x, a}: { x: number, a: number }) { }
|
||||
|
||||
a1([1, 2, [["world"]]]);
|
||||
a1([1, 2, [["world"]], 3]);
|
||||
|
||||
|
||||
// If the declaration includes an initializer expression (which is permitted only
|
||||
// when the parameter list occurs in conjunction with a function body),
|
||||
// the parameter type is the widened form (section 3.11) of the type of the initializer expression.
|
||||
|
||||
function b1(z = [undefined, null]) { };
|
||||
function b2(z = null, o = { x: 0, y: undefined }) { }
|
||||
function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { }
|
||||
|
||||
interface F1 {
|
||||
b5(z, y, [, a, b], {p, m: { q, r}});
|
||||
}
|
||||
|
||||
function b6([a, z, y] = [undefined, null, undefined]) { }
|
||||
function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { }
|
||||
|
||||
b1([1, 2, 3]); // z is widen to the type any[]
|
||||
b2("string", { x: 200, y: "string" });
|
||||
b2("string", { x: 200, y: true });
|
||||
|
||||
|
||||
// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3)
|
||||
enum Foo { a }
|
||||
function c0({z: {x, y: {j}}}) { }
|
||||
function c1({z} = { z: 10 }) { }
|
||||
function c2({z = 10}) { }
|
||||
function c3({b}: { b: number|string} = { b: "hello" }) { }
|
||||
function c5([a, b, [[c]]]) { }
|
||||
function c6([a, b, [[c=1]]]) { }
|
||||
|
||||
c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} }
|
||||
c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} }
|
||||
|
||||
c1(); // Implied type is {z:number}?
|
||||
c1({ z: 1 }) // Implied type is {z:number}?
|
||||
|
||||
c2({}); // Implied type is {z?: number}
|
||||
c2({z:1}); // Implied type is {z?: number}
|
||||
|
||||
c3({ b: 1 }); // Implied type is { b: number|string }.
|
||||
|
||||
c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]]
|
||||
c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]]
|
||||
|
||||
|
||||
// A parameter can be marked optional by following its name or binding pattern with a question mark (?)
|
||||
// or by including an initializer.
|
||||
|
||||
interface F2 {
|
||||
d3([a, b, c]?);
|
||||
d4({x, y, z}?);
|
||||
e0([a, b, c]);
|
||||
}
|
||||
|
||||
class C2 implements F2 {
|
||||
constructor() { }
|
||||
d3() { }
|
||||
d4() { }
|
||||
e0([a, b, c]) { }
|
||||
}
|
||||
|
||||
class C3 implements F2 {
|
||||
d3([a, b, c]) { }
|
||||
d4({x, y, z}) { }
|
||||
e0([a, b, c]) { }
|
||||
}
|
||||
|
||||
function d5({x, y} = { x: 1, y: 2 }) { }
|
||||
d5(); // Parameter is optional as its declaration included an initializer
|
||||
|
||||
// Destructuring parameter declarations do not permit type annotations on the individual binding patterns,
|
||||
// as such annotations would conflict with the already established meaning of colons in object literals.
|
||||
// Type annotations must instead be written on the top- level parameter declaration
|
||||
|
||||
function e1({x: number}) { } // x has type any NOT number
|
||||
function e2({x}: { x: number }) { } // x is type number
|
||||
function e3({x}: { x?: number }) { } // x is an optional with type number
|
||||
function e4({x: [number,string,any] }) { } // x has type [any, any, any]
|
||||
function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any]
|
||||
|
||||
function e6({x: [number, number, number]}) { } // error, duplicate identifier;
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'number'.
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'number'.
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'number'.
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ function e3({x}: { x?: number }) { } // x is an optional with type number
|
||||
function e4({x: [number,string,any] }) { } // x has type [any, any, any]
|
||||
function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any]
|
||||
|
||||
function e6({x: [number, number, number]}) { } // should be an error, duplicate identifier;
|
||||
function e6({x: [number, number, number]}) { } // error, duplicate identifier;
|
||||
|
||||
|
||||
|
||||
@@ -166,4 +166,4 @@ function e2({ x }) { } // x is type number
|
||||
function e3({ x }) { } // x is an optional with type number
|
||||
function e4({ x: [number, string, any] }) { } // x has type [any, any, any]
|
||||
function e5({ x: [a, b, c] }) { } // x has type [any, any, any]
|
||||
function e6({ x: [number, number, number] }) { } // should be an error, duplicate identifier;
|
||||
function e6({ x: [number, number, number] }) { } // error, duplicate identifier;
|
||||
@@ -1,314 +0,0 @@
|
||||
=== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts ===
|
||||
// Conformance for emitting ES6
|
||||
|
||||
// A parameter declaration may specify either an identifier or a binding pattern.
|
||||
// The identifiers specified in parameter declarations and binding patterns
|
||||
// in a parameter list must be unique within that parameter list.
|
||||
|
||||
// If the declaration includes a type annotation, the parameter is of that type
|
||||
function a1([a, b, [[c]]]: [number, number, string[][]]) { }
|
||||
>a1 : Symbol(a1, Decl(destructuringParameterDeclaration1ES6.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 7, 13))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 7, 15))
|
||||
>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 7, 21))
|
||||
|
||||
function a2(o: { x: number, a: number }) { }
|
||||
>a2 : Symbol(a2, Decl(destructuringParameterDeclaration1ES6.ts, 7, 60))
|
||||
>o : Symbol(o, Decl(destructuringParameterDeclaration1ES6.ts, 8, 12))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 8, 16))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 8, 27))
|
||||
|
||||
function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { };
|
||||
>a3 : Symbol(a3, Decl(destructuringParameterDeclaration1ES6.ts, 8, 44))
|
||||
>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 9, 13))
|
||||
>k : Symbol(k, Decl(destructuringParameterDeclaration1ES6.ts, 9, 15))
|
||||
>m : Symbol(m, Decl(destructuringParameterDeclaration1ES6.ts, 9, 23))
|
||||
>n : Symbol(n, Decl(destructuringParameterDeclaration1ES6.ts, 9, 25))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 9, 34))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 9, 36))
|
||||
>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 9, 39))
|
||||
>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 9, 46))
|
||||
>k : Symbol(k, Decl(destructuringParameterDeclaration1ES6.ts, 9, 57))
|
||||
>l : Symbol(l, Decl(destructuringParameterDeclaration1ES6.ts, 9, 68))
|
||||
>m : Symbol(m, Decl(destructuringParameterDeclaration1ES6.ts, 9, 73))
|
||||
>n : Symbol(n, Decl(destructuringParameterDeclaration1ES6.ts, 9, 85))
|
||||
>q : Symbol(q, Decl(destructuringParameterDeclaration1ES6.ts, 9, 98))
|
||||
|
||||
function a4({x, a}: { x: number, a: number }) { }
|
||||
>a4 : Symbol(a4, Decl(destructuringParameterDeclaration1ES6.ts, 9, 127))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 10, 13))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 10, 15))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 10, 21))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 10, 32))
|
||||
|
||||
a1([1, 2, [["world"]]]);
|
||||
>a1 : Symbol(a1, Decl(destructuringParameterDeclaration1ES6.ts, 0, 0))
|
||||
|
||||
a1([1, 2, [["world"]], 3]);
|
||||
>a1 : Symbol(a1, Decl(destructuringParameterDeclaration1ES6.ts, 0, 0))
|
||||
|
||||
|
||||
// If the declaration includes an initializer expression (which is permitted only
|
||||
// when the parameter list occurs in conjunction with a function body),
|
||||
// the parameter type is the widened form (section 3.11) of the type of the initializer expression.
|
||||
|
||||
function b1(z = [undefined, null]) { };
|
||||
>b1 : Symbol(b1, Decl(destructuringParameterDeclaration1ES6.ts, 13, 27))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 20, 12))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
function b2(z = null, o = { x: 0, y: undefined }) { }
|
||||
>b2 : Symbol(b2, Decl(destructuringParameterDeclaration1ES6.ts, 20, 39))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 21, 12))
|
||||
>o : Symbol(o, Decl(destructuringParameterDeclaration1ES6.ts, 21, 21))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 21, 27))
|
||||
>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 21, 33))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { }
|
||||
>b3 : Symbol(b3, Decl(destructuringParameterDeclaration1ES6.ts, 21, 53))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 22, 17))
|
||||
>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 22, 24))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 22, 32))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 22, 37))
|
||||
>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 22, 46))
|
||||
>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 22, 51))
|
||||
|
||||
interface F1 {
|
||||
>F1 : Symbol(F1, Decl(destructuringParameterDeclaration1ES6.ts, 22, 67))
|
||||
|
||||
b5(z, y, [, a, b], {p, m: { q, r}});
|
||||
>b5 : Symbol(b5, Decl(destructuringParameterDeclaration1ES6.ts, 24, 14))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 25, 7))
|
||||
>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 25, 9))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 25, 15))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 25, 18))
|
||||
>p : Symbol(p, Decl(destructuringParameterDeclaration1ES6.ts, 25, 24))
|
||||
>q : Symbol(q, Decl(destructuringParameterDeclaration1ES6.ts, 25, 31))
|
||||
>r : Symbol(r, Decl(destructuringParameterDeclaration1ES6.ts, 25, 34))
|
||||
}
|
||||
|
||||
function b6([a, z, y] = [undefined, null, undefined]) { }
|
||||
>b6 : Symbol(b6, Decl(destructuringParameterDeclaration1ES6.ts, 26, 1))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 28, 13))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 28, 15))
|
||||
>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 28, 18))
|
||||
>undefined : Symbol(undefined)
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { }
|
||||
>b7 : Symbol(b7, Decl(destructuringParameterDeclaration1ES6.ts, 28, 57))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 29, 14))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 29, 17))
|
||||
>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 29, 23))
|
||||
>d : Symbol(d, Decl(destructuringParameterDeclaration1ES6.ts, 29, 25))
|
||||
>undefined : Symbol(undefined)
|
||||
>undefined : Symbol(undefined)
|
||||
>undefined : Symbol(undefined)
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
b1([1, 2, 3]); // z is widen to the type any[]
|
||||
>b1 : Symbol(b1, Decl(destructuringParameterDeclaration1ES6.ts, 13, 27))
|
||||
|
||||
b2("string", { x: 200, y: "string" });
|
||||
>b2 : Symbol(b2, Decl(destructuringParameterDeclaration1ES6.ts, 20, 39))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 32, 14))
|
||||
>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 32, 22))
|
||||
|
||||
b2("string", { x: 200, y: true });
|
||||
>b2 : Symbol(b2, Decl(destructuringParameterDeclaration1ES6.ts, 20, 39))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 33, 14))
|
||||
>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 33, 22))
|
||||
|
||||
|
||||
// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3)
|
||||
enum Foo { a }
|
||||
>Foo : Symbol(Foo, Decl(destructuringParameterDeclaration1ES6.ts, 33, 34))
|
||||
>a : Symbol(Foo.a, Decl(destructuringParameterDeclaration1ES6.ts, 37, 10))
|
||||
|
||||
function c0({z: {x, y: {j}}}) { }
|
||||
>c0 : Symbol(c0, Decl(destructuringParameterDeclaration1ES6.ts, 37, 14))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 38, 17))
|
||||
>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 38, 24))
|
||||
|
||||
function c1({z} = { z: 10 }) { }
|
||||
>c1 : Symbol(c1, Decl(destructuringParameterDeclaration1ES6.ts, 38, 33))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 39, 13))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 39, 19))
|
||||
|
||||
function c2({z = 10}) { }
|
||||
>c2 : Symbol(c2, Decl(destructuringParameterDeclaration1ES6.ts, 39, 32))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 40, 13))
|
||||
|
||||
function c3({b}: { b: number|string} = { b: "hello" }) { }
|
||||
>c3 : Symbol(c3, Decl(destructuringParameterDeclaration1ES6.ts, 40, 25))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 41, 13))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 41, 18))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 41, 40))
|
||||
|
||||
function c5([a, b, [[c]]]) { }
|
||||
>c5 : Symbol(c5, Decl(destructuringParameterDeclaration1ES6.ts, 41, 58))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 42, 13))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 42, 15))
|
||||
>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 42, 21))
|
||||
|
||||
function c6([a, b, [[c=1]]]) { }
|
||||
>c6 : Symbol(c6, Decl(destructuringParameterDeclaration1ES6.ts, 42, 30))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 43, 13))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 43, 15))
|
||||
>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 43, 21))
|
||||
|
||||
c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} }
|
||||
>c0 : Symbol(c0, Decl(destructuringParameterDeclaration1ES6.ts, 37, 14))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 45, 4))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 45, 9))
|
||||
>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 45, 15))
|
||||
>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 45, 20))
|
||||
|
||||
c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} }
|
||||
>c0 : Symbol(c0, Decl(destructuringParameterDeclaration1ES6.ts, 37, 14))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 46, 4))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 46, 9))
|
||||
>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 46, 22))
|
||||
>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 46, 27))
|
||||
|
||||
c1(); // Implied type is {z:number}?
|
||||
>c1 : Symbol(c1, Decl(destructuringParameterDeclaration1ES6.ts, 38, 33))
|
||||
|
||||
c1({ z: 1 }) // Implied type is {z:number}?
|
||||
>c1 : Symbol(c1, Decl(destructuringParameterDeclaration1ES6.ts, 38, 33))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 49, 4))
|
||||
|
||||
c2({}); // Implied type is {z?: number}
|
||||
>c2 : Symbol(c2, Decl(destructuringParameterDeclaration1ES6.ts, 39, 32))
|
||||
|
||||
c2({z:1}); // Implied type is {z?: number}
|
||||
>c2 : Symbol(c2, Decl(destructuringParameterDeclaration1ES6.ts, 39, 32))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 52, 4))
|
||||
|
||||
c3({ b: 1 }); // Implied type is { b: number|string }.
|
||||
>c3 : Symbol(c3, Decl(destructuringParameterDeclaration1ES6.ts, 40, 25))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 54, 4))
|
||||
|
||||
c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]]
|
||||
>c5 : Symbol(c5, Decl(destructuringParameterDeclaration1ES6.ts, 41, 58))
|
||||
|
||||
c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]]
|
||||
>c5 : Symbol(c5, Decl(destructuringParameterDeclaration1ES6.ts, 41, 58))
|
||||
|
||||
|
||||
// A parameter can be marked optional by following its name or binding pattern with a question mark (?)
|
||||
// or by including an initializer.
|
||||
|
||||
interface F2 {
|
||||
>F2 : Symbol(F2, Decl(destructuringParameterDeclaration1ES6.ts, 57, 38))
|
||||
|
||||
d3([a, b, c]?);
|
||||
>d3 : Symbol(d3, Decl(destructuringParameterDeclaration1ES6.ts, 63, 14))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 64, 8))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 64, 10))
|
||||
>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 64, 13))
|
||||
|
||||
d4({x, y, z}?);
|
||||
>d4 : Symbol(d4, Decl(destructuringParameterDeclaration1ES6.ts, 64, 19))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 65, 8))
|
||||
>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 65, 10))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 65, 13))
|
||||
|
||||
e0([a, b, c]);
|
||||
>e0 : Symbol(e0, Decl(destructuringParameterDeclaration1ES6.ts, 65, 19))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 66, 8))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 66, 10))
|
||||
>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 66, 13))
|
||||
}
|
||||
|
||||
class C2 implements F2 {
|
||||
>C2 : Symbol(C2, Decl(destructuringParameterDeclaration1ES6.ts, 67, 1))
|
||||
>F2 : Symbol(F2, Decl(destructuringParameterDeclaration1ES6.ts, 57, 38))
|
||||
|
||||
constructor() { }
|
||||
d3() { }
|
||||
>d3 : Symbol(d3, Decl(destructuringParameterDeclaration1ES6.ts, 70, 21))
|
||||
|
||||
d4() { }
|
||||
>d4 : Symbol(d4, Decl(destructuringParameterDeclaration1ES6.ts, 71, 12))
|
||||
|
||||
e0([a, b, c]) { }
|
||||
>e0 : Symbol(e0, Decl(destructuringParameterDeclaration1ES6.ts, 72, 12))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 73, 8))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 73, 10))
|
||||
>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 73, 13))
|
||||
}
|
||||
|
||||
class C3 implements F2 {
|
||||
>C3 : Symbol(C3, Decl(destructuringParameterDeclaration1ES6.ts, 74, 1))
|
||||
>F2 : Symbol(F2, Decl(destructuringParameterDeclaration1ES6.ts, 57, 38))
|
||||
|
||||
d3([a, b, c]) { }
|
||||
>d3 : Symbol(d3, Decl(destructuringParameterDeclaration1ES6.ts, 76, 24))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 77, 8))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 77, 10))
|
||||
>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 77, 13))
|
||||
|
||||
d4({x, y, z}) { }
|
||||
>d4 : Symbol(d4, Decl(destructuringParameterDeclaration1ES6.ts, 77, 21))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 78, 8))
|
||||
>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 78, 10))
|
||||
>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 78, 13))
|
||||
|
||||
e0([a, b, c]) { }
|
||||
>e0 : Symbol(e0, Decl(destructuringParameterDeclaration1ES6.ts, 78, 21))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 79, 8))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 79, 10))
|
||||
>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 79, 13))
|
||||
}
|
||||
|
||||
function d5({x, y} = { x: 1, y: 2 }) { }
|
||||
>d5 : Symbol(d5, Decl(destructuringParameterDeclaration1ES6.ts, 80, 1))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 82, 13))
|
||||
>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 82, 15))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 82, 22))
|
||||
>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 82, 28))
|
||||
|
||||
d5(); // Parameter is optional as its declaration included an initializer
|
||||
>d5 : Symbol(d5, Decl(destructuringParameterDeclaration1ES6.ts, 80, 1))
|
||||
|
||||
// Destructuring parameter declarations do not permit type annotations on the individual binding patterns,
|
||||
// as such annotations would conflict with the already established meaning of colons in object literals.
|
||||
// Type annotations must instead be written on the top- level parameter declaration
|
||||
|
||||
function e1({x: number}) { } // x has type any NOT number
|
||||
>e1 : Symbol(e1, Decl(destructuringParameterDeclaration1ES6.ts, 83, 5))
|
||||
>number : Symbol(number, Decl(destructuringParameterDeclaration1ES6.ts, 89, 13))
|
||||
|
||||
function e2({x}: { x: number }) { } // x is type number
|
||||
>e2 : Symbol(e2, Decl(destructuringParameterDeclaration1ES6.ts, 89, 28))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 90, 13))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 90, 18))
|
||||
|
||||
function e3({x}: { x?: number }) { } // x is an optional with type number
|
||||
>e3 : Symbol(e3, Decl(destructuringParameterDeclaration1ES6.ts, 90, 35))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 91, 13))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 91, 18))
|
||||
|
||||
function e4({x: [number,string,any] }) { } // x has type [any, any, any]
|
||||
>e4 : Symbol(e4, Decl(destructuringParameterDeclaration1ES6.ts, 91, 36))
|
||||
>number : Symbol(number, Decl(destructuringParameterDeclaration1ES6.ts, 92, 17))
|
||||
>string : Symbol(string, Decl(destructuringParameterDeclaration1ES6.ts, 92, 24))
|
||||
>any : Symbol(any, Decl(destructuringParameterDeclaration1ES6.ts, 92, 31))
|
||||
|
||||
function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any]
|
||||
>e5 : Symbol(e5, Decl(destructuringParameterDeclaration1ES6.ts, 92, 42))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 93, 17))
|
||||
>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 93, 19))
|
||||
>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 93, 22))
|
||||
>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 93, 29))
|
||||
|
||||
function e6({x: [number, number, number]}) { } // should be an error, duplicate identifier;
|
||||
>e6 : Symbol(e6, Decl(destructuringParameterDeclaration1ES6.ts, 93, 64))
|
||||
>number : Symbol(number, Decl(destructuringParameterDeclaration1ES6.ts, 95, 17), Decl(destructuringParameterDeclaration1ES6.ts, 95, 24), Decl(destructuringParameterDeclaration1ES6.ts, 95, 32))
|
||||
>number : Symbol(number, Decl(destructuringParameterDeclaration1ES6.ts, 95, 17), Decl(destructuringParameterDeclaration1ES6.ts, 95, 24), Decl(destructuringParameterDeclaration1ES6.ts, 95, 32))
|
||||
>number : Symbol(number, Decl(destructuringParameterDeclaration1ES6.ts, 95, 17), Decl(destructuringParameterDeclaration1ES6.ts, 95, 24), Decl(destructuringParameterDeclaration1ES6.ts, 95, 32))
|
||||
|
||||
|
||||
|
||||
@@ -1,422 +0,0 @@
|
||||
=== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts ===
|
||||
// Conformance for emitting ES6
|
||||
|
||||
// A parameter declaration may specify either an identifier or a binding pattern.
|
||||
// The identifiers specified in parameter declarations and binding patterns
|
||||
// in a parameter list must be unique within that parameter list.
|
||||
|
||||
// If the declaration includes a type annotation, the parameter is of that type
|
||||
function a1([a, b, [[c]]]: [number, number, string[][]]) { }
|
||||
>a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void
|
||||
>a : number
|
||||
>b : number
|
||||
>c : string
|
||||
|
||||
function a2(o: { x: number, a: number }) { }
|
||||
>a2 : (o: { x: number; a: number; }) => void
|
||||
>o : { x: number; a: number; }
|
||||
>x : number
|
||||
>a : number
|
||||
|
||||
function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { };
|
||||
>a3 : ({j, k, l: {m, n}, q: [a, b, c]}: { j: number; k: string; l: { m: boolean; n: number; }; q: (string | number)[]; }) => void
|
||||
>j : number
|
||||
>k : string
|
||||
>l : any
|
||||
>m : boolean
|
||||
>n : number
|
||||
>q : any
|
||||
>a : string | number
|
||||
>b : string | number
|
||||
>c : string | number
|
||||
>j : number
|
||||
>k : string
|
||||
>l : { m: boolean; n: number; }
|
||||
>m : boolean
|
||||
>n : number
|
||||
>q : (string | number)[]
|
||||
|
||||
function a4({x, a}: { x: number, a: number }) { }
|
||||
>a4 : ({x, a}: { x: number; a: number; }) => void
|
||||
>x : number
|
||||
>a : number
|
||||
>x : number
|
||||
>a : number
|
||||
|
||||
a1([1, 2, [["world"]]]);
|
||||
>a1([1, 2, [["world"]]]) : void
|
||||
>a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void
|
||||
>[1, 2, [["world"]]] : [number, number, string[][]]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>[["world"]] : string[][]
|
||||
>["world"] : string[]
|
||||
>"world" : string
|
||||
|
||||
a1([1, 2, [["world"]], 3]);
|
||||
>a1([1, 2, [["world"]], 3]) : void
|
||||
>a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void
|
||||
>[1, 2, [["world"]], 3] : [number, number, string[][], number]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>[["world"]] : string[][]
|
||||
>["world"] : string[]
|
||||
>"world" : string
|
||||
>3 : number
|
||||
|
||||
|
||||
// If the declaration includes an initializer expression (which is permitted only
|
||||
// when the parameter list occurs in conjunction with a function body),
|
||||
// the parameter type is the widened form (section 3.11) of the type of the initializer expression.
|
||||
|
||||
function b1(z = [undefined, null]) { };
|
||||
>b1 : (z?: any[]) => void
|
||||
>z : any[]
|
||||
>[undefined, null] : null[]
|
||||
>undefined : undefined
|
||||
>null : null
|
||||
|
||||
function b2(z = null, o = { x: 0, y: undefined }) { }
|
||||
>b2 : (z?: any, o?: { x: number; y: any; }) => void
|
||||
>z : any
|
||||
>null : null
|
||||
>o : { x: number; y: any; }
|
||||
>{ x: 0, y: undefined } : { x: number; y: undefined; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>y : undefined
|
||||
>undefined : undefined
|
||||
|
||||
function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { }
|
||||
>b3 : ({z: {x, y: {j}}}?: { z: { x: string; y: { j: number; }; }; }) => void
|
||||
>z : any
|
||||
>x : string
|
||||
>y : any
|
||||
>j : number
|
||||
>{ z: { x: "hi", y: { j: 1 } } } : { z: { x: string; y: { j: number; }; }; }
|
||||
>z : { x: string; y: { j: number; }; }
|
||||
>{ x: "hi", y: { j: 1 } } : { x: string; y: { j: number; }; }
|
||||
>x : string
|
||||
>"hi" : string
|
||||
>y : { j: number; }
|
||||
>{ j: 1 } : { j: number; }
|
||||
>j : number
|
||||
>1 : number
|
||||
|
||||
interface F1 {
|
||||
>F1 : F1
|
||||
|
||||
b5(z, y, [, a, b], {p, m: { q, r}});
|
||||
>b5 : (z: any, y: any, [, a, b]: [any, any, any], {p, m: { q, r}}: { p: any; m: { q: any; r: any; }; }) => any
|
||||
>z : any
|
||||
>y : any
|
||||
> : undefined
|
||||
>a : any
|
||||
>b : any
|
||||
>p : any
|
||||
>m : any
|
||||
>q : any
|
||||
>r : any
|
||||
}
|
||||
|
||||
function b6([a, z, y] = [undefined, null, undefined]) { }
|
||||
>b6 : ([a, z, y]?: [undefined, null, undefined]) => void
|
||||
>a : any
|
||||
>z : any
|
||||
>y : any
|
||||
>[undefined, null, undefined] : [undefined, null, undefined]
|
||||
>undefined : undefined
|
||||
>null : null
|
||||
>undefined : undefined
|
||||
|
||||
function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { }
|
||||
>b7 : ([[a], b, [[c, d]]]?: [[undefined], undefined, [[undefined, undefined]]]) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
>d : any
|
||||
>[[undefined], undefined, [[undefined, undefined]]] : [[undefined], undefined, [[undefined, undefined]]]
|
||||
>[undefined] : [undefined]
|
||||
>undefined : undefined
|
||||
>undefined : undefined
|
||||
>[[undefined, undefined]] : [[undefined, undefined]]
|
||||
>[undefined, undefined] : [undefined, undefined]
|
||||
>undefined : undefined
|
||||
>undefined : undefined
|
||||
|
||||
b1([1, 2, 3]); // z is widen to the type any[]
|
||||
>b1([1, 2, 3]) : void
|
||||
>b1 : (z?: any[]) => void
|
||||
>[1, 2, 3] : number[]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>3 : number
|
||||
|
||||
b2("string", { x: 200, y: "string" });
|
||||
>b2("string", { x: 200, y: "string" }) : void
|
||||
>b2 : (z?: any, o?: { x: number; y: any; }) => void
|
||||
>"string" : string
|
||||
>{ x: 200, y: "string" } : { x: number; y: string; }
|
||||
>x : number
|
||||
>200 : number
|
||||
>y : string
|
||||
>"string" : string
|
||||
|
||||
b2("string", { x: 200, y: true });
|
||||
>b2("string", { x: 200, y: true }) : void
|
||||
>b2 : (z?: any, o?: { x: number; y: any; }) => void
|
||||
>"string" : string
|
||||
>{ x: 200, y: true } : { x: number; y: boolean; }
|
||||
>x : number
|
||||
>200 : number
|
||||
>y : boolean
|
||||
>true : boolean
|
||||
|
||||
|
||||
// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3)
|
||||
enum Foo { a }
|
||||
>Foo : Foo
|
||||
>a : Foo
|
||||
|
||||
function c0({z: {x, y: {j}}}) { }
|
||||
>c0 : ({z: {x, y: {j}}}: { z: { x: any; y: { j: any; }; }; }) => void
|
||||
>z : any
|
||||
>x : any
|
||||
>y : any
|
||||
>j : any
|
||||
|
||||
function c1({z} = { z: 10 }) { }
|
||||
>c1 : ({z}?: { z: number; }) => void
|
||||
>z : number
|
||||
>{ z: 10 } : { z: number; }
|
||||
>z : number
|
||||
>10 : number
|
||||
|
||||
function c2({z = 10}) { }
|
||||
>c2 : ({z = 10}: { z?: number; }) => void
|
||||
>z : number
|
||||
>10 : number
|
||||
|
||||
function c3({b}: { b: number|string} = { b: "hello" }) { }
|
||||
>c3 : ({b}?: { b: string | number; }) => void
|
||||
>b : string | number
|
||||
>b : string | number
|
||||
>{ b: "hello" } : { b: string; }
|
||||
>b : string
|
||||
>"hello" : string
|
||||
|
||||
function c5([a, b, [[c]]]) { }
|
||||
>c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
|
||||
function c6([a, b, [[c=1]]]) { }
|
||||
>c6 : ([a, b, [[c=1]]]: [any, any, [[number]]]) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>c : number
|
||||
>1 : number
|
||||
|
||||
c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} }
|
||||
>c0({z : { x: 1, y: { j: "world" } }}) : void
|
||||
>c0 : ({z: {x, y: {j}}}: { z: { x: any; y: { j: any; }; }; }) => void
|
||||
>{z : { x: 1, y: { j: "world" } }} : { z: { x: number; y: { j: string; }; }; }
|
||||
>z : { x: number; y: { j: string; }; }
|
||||
>{ x: 1, y: { j: "world" } } : { x: number; y: { j: string; }; }
|
||||
>x : number
|
||||
>1 : number
|
||||
>y : { j: string; }
|
||||
>{ j: "world" } : { j: string; }
|
||||
>j : string
|
||||
>"world" : string
|
||||
|
||||
c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} }
|
||||
>c0({z : { x: "string", y: { j: true } }}) : void
|
||||
>c0 : ({z: {x, y: {j}}}: { z: { x: any; y: { j: any; }; }; }) => void
|
||||
>{z : { x: "string", y: { j: true } }} : { z: { x: string; y: { j: boolean; }; }; }
|
||||
>z : { x: string; y: { j: boolean; }; }
|
||||
>{ x: "string", y: { j: true } } : { x: string; y: { j: boolean; }; }
|
||||
>x : string
|
||||
>"string" : string
|
||||
>y : { j: boolean; }
|
||||
>{ j: true } : { j: boolean; }
|
||||
>j : boolean
|
||||
>true : boolean
|
||||
|
||||
c1(); // Implied type is {z:number}?
|
||||
>c1() : void
|
||||
>c1 : ({z}?: { z: number; }) => void
|
||||
|
||||
c1({ z: 1 }) // Implied type is {z:number}?
|
||||
>c1({ z: 1 }) : void
|
||||
>c1 : ({z}?: { z: number; }) => void
|
||||
>{ z: 1 } : { z: number; }
|
||||
>z : number
|
||||
>1 : number
|
||||
|
||||
c2({}); // Implied type is {z?: number}
|
||||
>c2({}) : void
|
||||
>c2 : ({z = 10}: { z?: number; }) => void
|
||||
>{} : {}
|
||||
|
||||
c2({z:1}); // Implied type is {z?: number}
|
||||
>c2({z:1}) : void
|
||||
>c2 : ({z = 10}: { z?: number; }) => void
|
||||
>{z:1} : { z: number; }
|
||||
>z : number
|
||||
>1 : number
|
||||
|
||||
c3({ b: 1 }); // Implied type is { b: number|string }.
|
||||
>c3({ b: 1 }) : void
|
||||
>c3 : ({b}?: { b: string | number; }) => void
|
||||
>{ b: 1 } : { b: number; }
|
||||
>b : number
|
||||
>1 : number
|
||||
|
||||
c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]]
|
||||
>c5([1, 2, [["string"]]]) : void
|
||||
>c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void
|
||||
>[1, 2, [["string"]]] : [number, number, [[string]]]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>[["string"]] : [[string]]
|
||||
>["string"] : [string]
|
||||
>"string" : string
|
||||
|
||||
c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]]
|
||||
>c5([1, 2, [["string"]], false, true]) : void
|
||||
>c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void
|
||||
>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>[["string"]] : [[string]]
|
||||
>["string"] : [string]
|
||||
>"string" : string
|
||||
>false : boolean
|
||||
>true : boolean
|
||||
|
||||
|
||||
// A parameter can be marked optional by following its name or binding pattern with a question mark (?)
|
||||
// or by including an initializer.
|
||||
|
||||
interface F2 {
|
||||
>F2 : F2
|
||||
|
||||
d3([a, b, c]?);
|
||||
>d3 : ([a, b, c]?: [any, any, any]) => any
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
|
||||
d4({x, y, z}?);
|
||||
>d4 : ({x, y, z}?: { x: any; y: any; z: any; }) => any
|
||||
>x : any
|
||||
>y : any
|
||||
>z : any
|
||||
|
||||
e0([a, b, c]);
|
||||
>e0 : ([a, b, c]: [any, any, any]) => any
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
}
|
||||
|
||||
class C2 implements F2 {
|
||||
>C2 : C2
|
||||
>F2 : F2
|
||||
|
||||
constructor() { }
|
||||
d3() { }
|
||||
>d3 : () => void
|
||||
|
||||
d4() { }
|
||||
>d4 : () => void
|
||||
|
||||
e0([a, b, c]) { }
|
||||
>e0 : ([a, b, c]: [any, any, any]) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
}
|
||||
|
||||
class C3 implements F2 {
|
||||
>C3 : C3
|
||||
>F2 : F2
|
||||
|
||||
d3([a, b, c]) { }
|
||||
>d3 : ([a, b, c]: [any, any, any]) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
|
||||
d4({x, y, z}) { }
|
||||
>d4 : ({x, y, z}: { x: any; y: any; z: any; }) => void
|
||||
>x : any
|
||||
>y : any
|
||||
>z : any
|
||||
|
||||
e0([a, b, c]) { }
|
||||
>e0 : ([a, b, c]: [any, any, any]) => void
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
}
|
||||
|
||||
function d5({x, y} = { x: 1, y: 2 }) { }
|
||||
>d5 : ({x, y}?: { x: number; y: number; }) => void
|
||||
>x : number
|
||||
>y : number
|
||||
>{ x: 1, y: 2 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>1 : number
|
||||
>y : number
|
||||
>2 : number
|
||||
|
||||
d5(); // Parameter is optional as its declaration included an initializer
|
||||
>d5() : void
|
||||
>d5 : ({x, y}?: { x: number; y: number; }) => void
|
||||
|
||||
// Destructuring parameter declarations do not permit type annotations on the individual binding patterns,
|
||||
// as such annotations would conflict with the already established meaning of colons in object literals.
|
||||
// Type annotations must instead be written on the top- level parameter declaration
|
||||
|
||||
function e1({x: number}) { } // x has type any NOT number
|
||||
>e1 : ({x: number}: { x: any; }) => void
|
||||
>x : any
|
||||
>number : any
|
||||
|
||||
function e2({x}: { x: number }) { } // x is type number
|
||||
>e2 : ({x}: { x: number; }) => void
|
||||
>x : number
|
||||
>x : number
|
||||
|
||||
function e3({x}: { x?: number }) { } // x is an optional with type number
|
||||
>e3 : ({x}: { x?: number; }) => void
|
||||
>x : number
|
||||
>x : number
|
||||
|
||||
function e4({x: [number,string,any] }) { } // x has type [any, any, any]
|
||||
>e4 : ({x: [number,string,any] }: { x: [any, any, any]; }) => void
|
||||
>x : any
|
||||
>number : any
|
||||
>string : any
|
||||
>any : any
|
||||
|
||||
function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any]
|
||||
>e5 : ({x: [a, b, c]}: { x: [number, number, number]; }) => void
|
||||
>x : any
|
||||
>a : number
|
||||
>b : number
|
||||
>c : number
|
||||
>x : [number, number, number]
|
||||
|
||||
function e6({x: [number, number, number]}) { } // should be an error, duplicate identifier;
|
||||
>e6 : ({x: [number, number, number]}: { x: [any, any, any]; }) => void
|
||||
>x : any
|
||||
>number : any
|
||||
>number : any
|
||||
>number : any
|
||||
|
||||
|
||||
|
||||
@@ -50,9 +50,12 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
|
||||
Type '{ x: any; y: any; c: any; }' is not assignable to type '{ x: any; y: any; z: any; }'.
|
||||
Property 'z' is missing in type '{ x: any; y: any; c: any; }'.
|
||||
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(56,8): error TS2463: A binding pattern parameter cannot be optional in an implementation signature.
|
||||
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(65,18): error TS2300: Duplicate identifier 'number'.
|
||||
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(65,26): error TS2300: Duplicate identifier 'number'.
|
||||
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(65,34): error TS2300: Duplicate identifier 'number'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts (19 errors) ====
|
||||
==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts (22 errors) ====
|
||||
// A parameter declaration may specify either an identifier or a binding pattern.
|
||||
// The identifiers specified in parameter declarations and binding patterns
|
||||
// in a parameter list must be unique within that parameter list.
|
||||
@@ -188,7 +191,13 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
|
||||
// as such annotations would conflict with the already established meaning of colons in object literals.
|
||||
// Type annotations must instead be written on the top- level parameter declaration
|
||||
|
||||
function e0({x: [number, number, number]}) { } // should be an error, duplicate identifier;
|
||||
function e0({x: [number, number, number]}) { } // error, duplicate identifier;
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'number'.
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'number'.
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'number'.
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class C4 implements F2 {
|
||||
// as such annotations would conflict with the already established meaning of colons in object literals.
|
||||
// Type annotations must instead be written on the top- level parameter declaration
|
||||
|
||||
function e0({x: [number, number, number]}) { } // should be an error, duplicate identifier;
|
||||
function e0({x: [number, number, number]}) { } // error, duplicate identifier;
|
||||
|
||||
|
||||
|
||||
@@ -146,4 +146,4 @@ var C4 = (function () {
|
||||
// Type annotations must instead be written on the top- level parameter declaration
|
||||
function e0(_a) {
|
||||
var _b = _a.x, number = _b[0], number = _b[1], number = _b[2];
|
||||
} // should be an error, duplicate identifier;
|
||||
} // error, duplicate identifier;
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(2,13): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(2,17): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(2,21): error TS2300: Duplicate identifier 'b'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(2,27): error TS2300: Duplicate identifier 'b'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(3,14): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(3,17): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(4,14): error TS2300: Duplicate identifier 'b'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(4,19): error TS2300: Duplicate identifier 'b'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(5,14): error TS2300: Duplicate identifier 'c'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(5,17): error TS2300: Duplicate identifier 'c'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(5,22): error TS2300: Duplicate identifier 'c'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(6,14): error TS2300: Duplicate identifier 'd'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(6,20): error TS2300: Duplicate identifier 'd'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(7,14): error TS2300: Duplicate identifier 'e'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(7,21): error TS2300: Duplicate identifier 'e'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(7,27): error TS2300: Duplicate identifier 'e'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(7,34): error TS2300: Duplicate identifier 'e'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(7,39): error TS2300: Duplicate identifier 'e'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(7,48): error TS2300: Duplicate identifier 'e'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(8,14): error TS2300: Duplicate identifier 'f'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts(8,20): error TS2300: Duplicate identifier 'f'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts (21 errors) ====
|
||||
|
||||
function f0(a, [a, [b]], {b}) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'b'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'b'.
|
||||
function f1([a, a]) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
function f2({b}, {b}) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'b'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'b'.
|
||||
function f3([c,[c],[[c]]]) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'c'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'c'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'c'.
|
||||
function f4({d, d:{d}}) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'd'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'd'.
|
||||
function f5({e, e: {e}}, {e}, [d,e, [[e]]], ...e) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'e'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'e'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'e'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'e'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'e'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'e'.
|
||||
function f6([f, ...f]) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'f'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'f'.
|
||||
function f7(a, func = (a) => { return 1 }) { } // not error
|
||||
@@ -0,0 +1,44 @@
|
||||
//// [duplicateIdentifierBindingElementInParameterDeclaration1.ts]
|
||||
|
||||
function f0(a, [a, [b]], {b}) { }
|
||||
function f1([a, a]) { }
|
||||
function f2({b}, {b}) { }
|
||||
function f3([c,[c],[[c]]]) { }
|
||||
function f4({d, d:{d}}) { }
|
||||
function f5({e, e: {e}}, {e}, [d,e, [[e]]], ...e) { }
|
||||
function f6([f, ...f]) { }
|
||||
function f7(a, func = (a) => { return 1 }) { } // not error
|
||||
|
||||
//// [duplicateIdentifierBindingElementInParameterDeclaration1.js]
|
||||
function f0(a, _a, _b) {
|
||||
var a = _a[0], b = _a[1][0];
|
||||
var b = _b.b;
|
||||
}
|
||||
function f1(_a) {
|
||||
var a = _a[0], a = _a[1];
|
||||
}
|
||||
function f2(_a, _b) {
|
||||
var b = _a.b;
|
||||
var b = _b.b;
|
||||
}
|
||||
function f3(_a) {
|
||||
var c = _a[0], c = _a[1][0], c = _a[2][0][0];
|
||||
}
|
||||
function f4(_a) {
|
||||
var d = _a.d, d = _a.d.d;
|
||||
}
|
||||
function f5(_a, _b, _c) {
|
||||
var e = _a.e, e = _a.e.e;
|
||||
var e = _b.e;
|
||||
var d = _c[0], e = _c[1], e = _c[2][0][0];
|
||||
var e = [];
|
||||
for (var _i = 3; _i < arguments.length; _i++) {
|
||||
e[_i - 3] = arguments[_i];
|
||||
}
|
||||
}
|
||||
function f6(_a) {
|
||||
var f = _a[0], f = _a.slice(1);
|
||||
}
|
||||
function f7(a, func) {
|
||||
if (func === void 0) { func = function (a) { return 1; }; }
|
||||
} // not error
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(3,13): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(3,17): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(3,21): error TS2300: Duplicate identifier 'b'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(3,27): error TS2300: Duplicate identifier 'b'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(4,14): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(4,17): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(5,14): error TS2300: Duplicate identifier 'b'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(5,19): error TS2300: Duplicate identifier 'b'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(6,14): error TS2300: Duplicate identifier 'c'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(6,18): error TS2300: Duplicate identifier 'c'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(6,24): error TS2300: Duplicate identifier 'c'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(7,14): error TS2300: Duplicate identifier 'd'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(7,21): error TS2300: Duplicate identifier 'd'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(8,14): error TS2300: Duplicate identifier 'e'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(8,21): error TS2300: Duplicate identifier 'e'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(8,27): error TS2300: Duplicate identifier 'e'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(8,35): error TS2300: Duplicate identifier 'e'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(8,40): error TS2300: Duplicate identifier 'e'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(8,49): error TS2300: Duplicate identifier 'e'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(9,14): error TS2300: Duplicate identifier 'f'.
|
||||
tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts(9,20): error TS2300: Duplicate identifier 'f'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts (21 errors) ====
|
||||
|
||||
"use strict"
|
||||
function f0(a, [a, [b]], {b}) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'b'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'b'.
|
||||
function f1([a, a]) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
function f2({b}, {b}) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'b'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'b'.
|
||||
function f3([c, [c], [[c]]]) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'c'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'c'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'c'.
|
||||
function f4({d, d: {d}}) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'd'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'd'.
|
||||
function f5({e, e: {e}}, {e}, [d, e, [[e]]], ...e) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'e'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'e'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'e'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'e'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'e'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'e'.
|
||||
function f6([f, ...f]) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'f'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'f'.
|
||||
function f7(a, func = (a) => { return 1 }){ } // not error
|
||||
@@ -0,0 +1,46 @@
|
||||
//// [duplicateIdentifierBindingElementInParameterDeclaration2.ts]
|
||||
|
||||
"use strict"
|
||||
function f0(a, [a, [b]], {b}) { }
|
||||
function f1([a, a]) { }
|
||||
function f2({b}, {b}) { }
|
||||
function f3([c, [c], [[c]]]) { }
|
||||
function f4({d, d: {d}}) { }
|
||||
function f5({e, e: {e}}, {e}, [d, e, [[e]]], ...e) { }
|
||||
function f6([f, ...f]) { }
|
||||
function f7(a, func = (a) => { return 1 }){ } // not error
|
||||
|
||||
//// [duplicateIdentifierBindingElementInParameterDeclaration2.js]
|
||||
"use strict";
|
||||
function f0(a, _a, _b) {
|
||||
var a = _a[0], b = _a[1][0];
|
||||
var b = _b.b;
|
||||
}
|
||||
function f1(_a) {
|
||||
var a = _a[0], a = _a[1];
|
||||
}
|
||||
function f2(_a, _b) {
|
||||
var b = _a.b;
|
||||
var b = _b.b;
|
||||
}
|
||||
function f3(_a) {
|
||||
var c = _a[0], c = _a[1][0], c = _a[2][0][0];
|
||||
}
|
||||
function f4(_a) {
|
||||
var d = _a.d, d = _a.d.d;
|
||||
}
|
||||
function f5(_a, _b, _c) {
|
||||
var e = _a.e, e = _a.e.e;
|
||||
var e = _b.e;
|
||||
var d = _c[0], e = _c[1], e = _c[2][0][0];
|
||||
var e = [];
|
||||
for (var _i = 3; _i < arguments.length; _i++) {
|
||||
e[_i - 3] = arguments[_i];
|
||||
}
|
||||
}
|
||||
function f6(_a) {
|
||||
var f = _a[0], f = _a.slice(1);
|
||||
}
|
||||
function f7(a, func) {
|
||||
if (func === void 0) { func = function (a) { return 1; }; }
|
||||
} // not error
|
||||
@@ -117,7 +117,7 @@ var Foo = (function () {
|
||||
})();
|
||||
var Foo;
|
||||
(function (Foo) {
|
||||
Foo.x; // error for redeclaring var in a different parent
|
||||
// error for redeclaring var in a different parent
|
||||
})(Foo || (Foo = {}));
|
||||
var N;
|
||||
(function (N) {
|
||||
|
||||
@@ -83,9 +83,9 @@ define(["require", "exports"], function (require, exports) {
|
||||
var M2;
|
||||
(function (M2) {
|
||||
var v;
|
||||
M2.v; // one error (visibility)
|
||||
// one error (visibility)
|
||||
var w;
|
||||
M2.w; // two errors (visibility and type mismatch)
|
||||
// two errors (visibility and type mismatch)
|
||||
})(M2 || (M2 = {}));
|
||||
var M;
|
||||
(function (M) {
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
|
||||
//// [emptyFile-declaration.js]
|
||||
//# sourceMappingURL=emptyFile-declaration.js.map
|
||||
|
||||
|
||||
//// [emptyFile-declaration.d.ts]
|
||||
@@ -1,2 +0,0 @@
|
||||
//// [emptyFile-declaration.js.map]
|
||||
{"version":3,"file":"emptyFile-declaration.js","sourceRoot":"","sources":["emptyFile-declaration.ts"],"names":[],"mappings":""}
|
||||
@@ -1,7 +0,0 @@
|
||||
===================================================================
|
||||
JsFile: emptyFile-declaration.js
|
||||
mapUrl: emptyFile-declaration.js.map
|
||||
sourceRoot:
|
||||
sources: emptyFile-declaration.ts
|
||||
===================================================================
|
||||
>>>//# sourceMappingURL=emptyFile-declaration.js.map
|
||||
@@ -2,6 +2,4 @@
|
||||
|
||||
|
||||
//// [emptyFile-souremap.js]
|
||||
//# sourceMappingURL=emptyFile-souremap.js.map
|
||||
|
||||
//// [emptyFile-souremap.d.ts]
|
||||
//# sourceMappingURL=emptyFile-souremap.js.map
|
||||
@@ -22,10 +22,3 @@ var A = (function () {
|
||||
};
|
||||
return A;
|
||||
})();
|
||||
//# sourceMappingURL=es3-amd.js.map
|
||||
|
||||
//// [es3-amd.d.ts]
|
||||
declare class A {
|
||||
constructor();
|
||||
B(): number;
|
||||
}
|
||||
Loaded 100 of 397 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user