TypeScript/tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType.ts

12 lines
415 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
// @noimplicitany: true
// these should be errors
function foo(x) { };
function bar(x: number, y) { }; // error at "y"; no error at "x"
function func2(a, b, c) { }; // error at "a,b,c"
function func3(...args) { }; // error at "args"
function func4(z= null, w= undefined) { }; // error at "z,w"
// these shouldn't be errors
function noError1(x= 3, y= 2) { };
function noError2(x: number, y: string) { };