107 lines
2.6 KiB
Text
107 lines
2.6 KiB
Text
=== tests/cases/compiler/collisionRestParameterClassMethod.ts ===
|
|
class c1 {
|
|
>c1 : c1
|
|
|
|
public foo(_i: number, ...restParameters) { //_i is error
|
|
>foo : (_i: number, ...restParameters: any[]) => void
|
|
>_i : number
|
|
>restParameters : any[]
|
|
|
|
var _i = 10; // no error
|
|
>_i : number
|
|
>10 : number
|
|
}
|
|
public fooNoError(_i: number) { // no error
|
|
>fooNoError : (_i: number) => void
|
|
>_i : number
|
|
|
|
var _i = 10; // no error
|
|
>_i : number
|
|
>10 : number
|
|
}
|
|
public f4(_i: number, ...rest); // no codegen no error
|
|
>f4 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; }
|
|
>_i : number
|
|
>rest : any[]
|
|
|
|
public f4(_i: string, ...rest); // no codegen no error
|
|
>f4 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; }
|
|
>_i : string
|
|
>rest : any[]
|
|
|
|
public f4(_i: any, ...rest) { // error
|
|
>f4 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; }
|
|
>_i : any
|
|
>rest : any[]
|
|
|
|
var _i: any; // no error
|
|
>_i : any
|
|
}
|
|
|
|
public f4NoError(_i: number); // no error
|
|
>f4NoError : { (_i: number): any; (_i: string): any; }
|
|
>_i : number
|
|
|
|
public f4NoError(_i: string); // no error
|
|
>f4NoError : { (_i: number): any; (_i: string): any; }
|
|
>_i : string
|
|
|
|
public f4NoError(_i: any) { // no error
|
|
>f4NoError : { (_i: number): any; (_i: string): any; }
|
|
>_i : any
|
|
|
|
var _i: any; // no error
|
|
>_i : any
|
|
}
|
|
}
|
|
|
|
declare class c2 {
|
|
>c2 : c2
|
|
|
|
public foo(_i: number, ...restParameters); // No error - no code gen
|
|
>foo : (_i: number, ...restParameters: any[]) => any
|
|
>_i : number
|
|
>restParameters : any[]
|
|
|
|
public fooNoError(_i: number); // no error
|
|
>fooNoError : (_i: number) => any
|
|
>_i : number
|
|
|
|
public f4(_i: number, ...rest); // no codegen no error
|
|
>f4 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; }
|
|
>_i : number
|
|
>rest : any[]
|
|
|
|
public f4(_i: string, ...rest); // no codegen no error
|
|
>f4 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; }
|
|
>_i : string
|
|
>rest : any[]
|
|
|
|
public f4NoError(_i: number); // no error
|
|
>f4NoError : { (_i: number): any; (_i: string): any; }
|
|
>_i : number
|
|
|
|
public f4NoError(_i: string); // no error
|
|
>f4NoError : { (_i: number): any; (_i: string): any; }
|
|
>_i : string
|
|
}
|
|
|
|
class c3 {
|
|
>c3 : c3
|
|
|
|
public foo(...restParameters) {
|
|
>foo : (...restParameters: any[]) => void
|
|
>restParameters : any[]
|
|
|
|
var _i = 10; // no error
|
|
>_i : number
|
|
>10 : number
|
|
}
|
|
public fooNoError() {
|
|
>fooNoError : () => void
|
|
|
|
var _i = 10; // no error
|
|
>_i : number
|
|
>10 : number
|
|
}
|
|
}
|