You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior:
Compile error. Either MyClass incorrectly implements I interface requiring to define z as z=()=>alert(this.x + this.y) or at alert(o.z) reporting there is no such a property on o, or report something similar to FlowType.
Actual behavior:
No compiler warnings and runtime error when trying to invoke o.z().
Note:
When I change a definition of I this way: interface I { x: number, y: number, z(): void }, I get an error Property 'z' does not exist on type '{ x: number; y: number; }' as expected.