1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
=== tests/cases/compiler/collisionArgumentsClassConstructor.ts ===
// Constructors
class c1 {
>c1 : c1
constructor(i: number, ...arguments) { // error
>i : number
>arguments : any[]
var arguments: any[]; // no error
>arguments : any[]
}
}
class c12 {
>c12 : c12
constructor(arguments: number, ...rest) { // error
>arguments : number
>rest : any[]
var arguments = 10; // no error
>arguments : number
>10 : 10
}
}
class c1NoError {
>c1NoError : c1NoError
constructor(arguments: number) { // no error
>arguments : number
var arguments = 10; // no error
>arguments : number
>10 : 10
}
}
class c2 {
>c2 : c2
constructor(...restParameters) {
>restParameters : any[]
var arguments = 10; // no error
>arguments : number
>10 : 10
}
}
class c2NoError {
>c2NoError : c2NoError
constructor() {
var arguments = 10; // no error
>arguments : number
>10 : 10
}
}
class c3 {
>c3 : c3
constructor(public arguments: number, ...restParameters) { //arguments is error
>arguments : number
>restParameters : any[]
var arguments = 10; // no error
>arguments : number
>10 : 10
}
}
class c3NoError {
>c3NoError : c3NoError
constructor(public arguments: number) { // no error
>arguments : number
var arguments = 10; // no error
>arguments : number
>10 : 10
}
}
declare class c4 {
>c4 : c4
constructor(i: number, ...arguments); // No error - no code gen
>i : number
>arguments : any[]
}
declare class c42 {
>c42 : c42
constructor(arguments: number, ...rest); // No error - no code gen
>arguments : number
>rest : any[]
}
declare class c4NoError {
>c4NoError : c4NoError
constructor(arguments: number); // no error
>arguments : number
}
class c5 {
>c5 : c5
constructor(i: number, ...arguments); // no codegen no error
>i : number
>arguments : any[]
constructor(i: string, ...arguments); // no codegen no error
>i : string
>arguments : any[]
constructor(i: any, ...arguments) { // error
>i : any
>arguments : any[]
var arguments: any[]; // no error
>arguments : any[]
}
}
class c52 {
>c52 : c52
constructor(arguments: number, ...rest); // no codegen no error
>arguments : number
>rest : any[]
constructor(arguments: string, ...rest); // no codegen no error
>arguments : string
>rest : any[]
constructor(arguments: any, ...rest) { // error
>arguments : any
>rest : any[]
var arguments: any; // no error
>arguments : any
}
}
class c5NoError {
>c5NoError : c5NoError
constructor(arguments: number); // no error
>arguments : number
constructor(arguments: string); // no error
>arguments : string
constructor(arguments: any) { // no error
>arguments : any
var arguments: any; // no error
>arguments : any
}
}
declare class c6 {
>c6 : c6
constructor(i: number, ...arguments); // no codegen no error
>i : number
>arguments : any[]
constructor(i: string, ...arguments); // no codegen no error
>i : string
>arguments : any[]
}
declare class c62 {
>c62 : c62
constructor(arguments: number, ...rest); // no codegen no error
>arguments : number
>rest : any[]
constructor(arguments: string, ...rest); // no codegen no error
>arguments : string
>rest : any[]
}
declare class c6NoError {
>c6NoError : c6NoError
constructor(arguments: number); // no error
>arguments : number
constructor(arguments: string); // no error
>arguments : string
}
|