13 lines
462 B
Plaintext
13 lines
462 B
Plaintext
==== 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'.
|
|
});
|
|
|