13 lines
No EOL
462 B
Text
13 lines
No EOL
462 B
Text
==== tests/cases/compiler/noErrorsInCallback.ts (2 errors) ====
|
|
class Bar {
|
|
constructor(public foo: string) { }
|
|
}
|
|
var one = new Bar({}); // Error
|
|
~~
|
|
!!! Argument of type '{}' is not assignable to parameter of type 'string'.
|
|
[].forEach(() => {
|
|
var two = new Bar({}); // No error?
|
|
~~
|
|
!!! Argument of type '{}' is not assignable to parameter of type 'string'.
|
|
});
|
|
|