11 lines
401 B
Plaintext
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. |