TypeScript/tests/cases/compiler/targetTypeBaseCalls.ts
2014-07-12 17:30:19 -07:00

18 lines
786 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function foo(x: (s: string) => void) { }
class Foo { constructor(x: (s: string) => void){} }
foo(function(s) { s = 5 }); // Error, cant assign number to string
new Foo(function(s) { s = 5 }); // error, if types are applied correctly
class Bar extends Foo { constructor() { super(function(s) { s = 5 }) } } // error, if types are applied correctly