13 lines
316 B
Plaintext
13 lines
316 B
Plaintext
==== tests/cases/compiler/assignToFn.ts (1 errors) ====
|
|
module M {
|
|
interface I {
|
|
f(n:number):boolean;
|
|
}
|
|
|
|
var x:I={ f:function(n) { return true; } };
|
|
|
|
x.f="hello";
|
|
~~~
|
|
!!! Type 'string' is not assignable to type '(n: number) => boolean'.
|
|
}
|
|
|