TypeScript/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt
2014-07-24 19:39:50 -07:00

11 lines
401 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
~~~
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
}}
~
!!! Declaration or statement expected.