63 lines
1.6 KiB
Text
63 lines
1.6 KiB
Text
|
=== tests/cases/compiler/collisionRestParameterFunctionExpressions.ts ===
|
||
|
function foo() {
|
||
|
>foo : () => void
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
}
|