mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Add testcases
This commit is contained in:
@@ -17,9 +17,11 @@ tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts
|
||||
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 (19 errors) ====
|
||||
==== tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts (21 errors) ====
|
||||
|
||||
function f0(a, [a, [b]], {b}) { }
|
||||
~
|
||||
@@ -65,6 +67,9 @@ tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration1.ts
|
||||
!!! 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
|
||||
@@ -6,9 +6,8 @@ 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) {
|
||||
@@ -37,3 +36,9 @@ function f5(_a, _b, _c) {
|
||||
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
|
||||
|
||||
@@ -17,9 +17,11 @@ tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts
|
||||
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 (19 errors) ====
|
||||
==== tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts (21 errors) ====
|
||||
|
||||
"use strict"
|
||||
function f0(a, [a, [b]], {b}) { }
|
||||
@@ -66,6 +68,9 @@ tests/cases/compiler/duplicateIdentifierBindingElementInParameterDeclaration2.ts
|
||||
!!! 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
|
||||
@@ -7,9 +7,8 @@ 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";
|
||||
@@ -39,3 +38,9 @@ function f5(_a, _b, _c) {
|
||||
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
|
||||
|
||||
@@ -6,5 +6,5 @@ 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
|
||||
@@ -7,5 +7,5 @@ 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
|
||||
Reference in New Issue
Block a user