TypeScript Version: 2.1.4
Code
// compile with --noImplicitAny switch
function f1(props: any): any {
return {
a: [],
...props
};
}
function f2(data: any): void {
};
Expected behavior:
Code is compiled without errors.
Actual behavior:
8 function f2(data: any): void {
~~~~~~~~~
test.ts(8,13): error TS7006: Parameter 'data' implicitly has an 'any' type.
These variants are compiled fine for some weird reason:
function f1(props: any): any {
return {
a: 1,
...props
};
}
function f2(data: any): void {
};
function f1(props: any): any {
return {
a: [],
};
}
function f2(data: any): void {
};
TypeScript Version: 2.1.4
Code
Expected behavior:
Code is compiled without errors.
Actual behavior:
These variants are compiled fine for some weird reason: