TypeScript/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt
2014-09-11 16:11:08 -07:00

11 lines
429 B
Plaintext

==== tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts (2 errors) ====
class A {
constructor(public a1: string) {
}
}
function foo(x = new A(123)) { //should error, 123 is not string
~~~
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
}}
~
!!! error TS1128: Declaration or statement expected.