2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/collisionArgumentsClassConstructor.ts(3,28): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
|
|
|
tests/cases/compiler/collisionArgumentsClassConstructor.ts(8,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
|
|
|
tests/cases/compiler/collisionArgumentsClassConstructor.ts(30,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
|
|
|
tests/cases/compiler/collisionArgumentsClassConstructor.ts(53,25): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
|
|
|
tests/cases/compiler/collisionArgumentsClassConstructor.ts(61,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/collisionArgumentsClassConstructor.ts (5 errors) ====
|
|
|
|
// Constructors
|
|
|
|
class c1 {
|
|
|
|
constructor(i: number, ...arguments) { // error
|
|
|
|
~~~~~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
2014-07-13 01:04:16 +02:00
|
|
|
var arguments: any[]; // no error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
class c12 {
|
|
|
|
constructor(arguments: number, ...rest) { // error
|
|
|
|
~~~~~~~~~~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
2014-07-13 01:04:16 +02:00
|
|
|
var arguments = 10; // no error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
class c1NoError {
|
|
|
|
constructor(arguments: number) { // no error
|
|
|
|
var arguments = 10; // no error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class c2 {
|
|
|
|
constructor(...restParameters) {
|
|
|
|
var arguments = 10; // no error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
class c2NoError {
|
|
|
|
constructor() {
|
|
|
|
var arguments = 10; // no error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class c3 {
|
|
|
|
constructor(public arguments: number, ...restParameters) { //arguments is error
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
2014-07-13 01:04:16 +02:00
|
|
|
var arguments = 10; // no error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
class c3NoError {
|
|
|
|
constructor(public arguments: number) { // no error
|
|
|
|
var arguments = 10; // no error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
declare class c4 {
|
|
|
|
constructor(i: number, ...arguments); // No error - no code gen
|
|
|
|
}
|
|
|
|
declare class c42 {
|
|
|
|
constructor(arguments: number, ...rest); // No error - no code gen
|
|
|
|
}
|
|
|
|
declare class c4NoError {
|
|
|
|
constructor(arguments: number); // no error
|
|
|
|
}
|
|
|
|
|
|
|
|
class c5 {
|
|
|
|
constructor(i: number, ...arguments); // no codegen no error
|
|
|
|
constructor(i: string, ...arguments); // no codegen no error
|
|
|
|
constructor(i: any, ...arguments) { // error
|
|
|
|
~~~~~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
2014-07-13 01:04:16 +02:00
|
|
|
var arguments: any[]; // no error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class c52 {
|
|
|
|
constructor(arguments: number, ...rest); // no codegen no error
|
|
|
|
constructor(arguments: string, ...rest); // no codegen no error
|
|
|
|
constructor(arguments: any, ...rest) { // error
|
|
|
|
~~~~~~~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
2014-07-13 01:04:16 +02:00
|
|
|
var arguments: any; // no error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class c5NoError {
|
|
|
|
constructor(arguments: number); // no error
|
|
|
|
constructor(arguments: string); // no error
|
|
|
|
constructor(arguments: any) { // no error
|
|
|
|
var arguments: any; // no error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
declare class c6 {
|
|
|
|
constructor(i: number, ...arguments); // no codegen no error
|
|
|
|
constructor(i: string, ...arguments); // no codegen no error
|
|
|
|
}
|
|
|
|
declare class c62 {
|
|
|
|
constructor(arguments: number, ...rest); // no codegen no error
|
|
|
|
constructor(arguments: string, ...rest); // no codegen no error
|
|
|
|
}
|
|
|
|
|
|
|
|
declare class c6NoError {
|
|
|
|
constructor(arguments: number); // no error
|
|
|
|
constructor(arguments: string); // no error
|
|
|
|
}
|