88 lines
2.3 KiB
Text
88 lines
2.3 KiB
Text
=== tests/cases/compiler/collisionRestParameterFunction.ts ===
|
|
// Functions
|
|
function f1(_i: number, ...restParameters) { //_i is error
|
|
>f1 : (_i: number, ...restParameters: any[]) => void
|
|
>_i : number
|
|
>restParameters : any[]
|
|
|
|
var _i = 10; // no error
|
|
>_i : number
|
|
}
|
|
function f1NoError(_i: number) { // no error
|
|
>f1NoError : (_i: number) => void
|
|
>_i : number
|
|
|
|
var _i = 10; // no error
|
|
>_i : number
|
|
}
|
|
|
|
declare function f2(_i: number, ...restParameters); // no error - no code gen
|
|
>f2 : (_i: number, ...restParameters: any[]) => any
|
|
>_i : number
|
|
>restParameters : any[]
|
|
|
|
declare function f2NoError(_i: number); // no error
|
|
>f2NoError : (_i: number) => any
|
|
>_i : number
|
|
|
|
function f3(...restParameters) {
|
|
>f3 : (...restParameters: any[]) => void
|
|
>restParameters : any[]
|
|
|
|
var _i = 10; // no error
|
|
>_i : number
|
|
}
|
|
function f3NoError() {
|
|
>f3NoError : () => void
|
|
|
|
var _i = 10; // no error
|
|
>_i : number
|
|
}
|
|
|
|
function f4(_i: number, ...rest); // no codegen no error
|
|
>f4 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; }
|
|
>_i : number
|
|
>rest : any[]
|
|
|
|
function f4(_i: string, ...rest); // no codegen no error
|
|
>f4 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; }
|
|
>_i : string
|
|
>rest : any[]
|
|
|
|
function f4(_i: any, ...rest) { // error
|
|
>f4 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; }
|
|
>_i : any
|
|
>rest : any[]
|
|
}
|
|
|
|
function f4NoError(_i: number); // no error
|
|
>f4NoError : { (_i: number): any; (_i: string): any; }
|
|
>_i : number
|
|
|
|
function f4NoError(_i: string); // no error
|
|
>f4NoError : { (_i: number): any; (_i: string): any; }
|
|
>_i : string
|
|
|
|
function f4NoError(_i: any) { // no error
|
|
>f4NoError : { (_i: number): any; (_i: string): any; }
|
|
>_i : any
|
|
}
|
|
|
|
declare function f5(_i: number, ...rest); // no codegen no error
|
|
>f5 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; }
|
|
>_i : number
|
|
>rest : any[]
|
|
|
|
declare function f5(_i: string, ...rest); // no codegen no error
|
|
>f5 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; }
|
|
>_i : string
|
|
>rest : any[]
|
|
|
|
declare function f6(_i: number); // no codegen no error
|
|
>f6 : { (_i: number): any; (_i: string): any; }
|
|
>_i : number
|
|
|
|
declare function f6(_i: string); // no codegen no error
|
|
>f6 : { (_i: number): any; (_i: string): any; }
|
|
>_i : string
|
|
|