2014-11-05 21:26:03 +01:00
|
|
|
|
tests/cases/compiler/targetTypeBaseCalls.ts(9,19): error TS2322: Type 'number' is not assignable to type 'string'.
|
|
|
|
|
tests/cases/compiler/targetTypeBaseCalls.ts(13,23): error TS2322: Type 'number' is not assignable to type 'string'.
|
|
|
|
|
tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2322: Type 'number' is not assignable to type 'string'.
|
2014-09-12 22:35:07 +02:00
|
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
|
==== tests/cases/compiler/targetTypeBaseCalls.ts (3 errors) ====
|
|
|
|
|
function foo(x: (s: string) => void) { }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Foo { constructor(x: (s: string) => void){} }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foo(function(s) { s = 5 }); // Error, can’t assign number to string
|
|
|
|
|
~
|
2014-11-05 21:26:03 +01:00
|
|
|
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new Foo(function(s) { s = 5 }); // error, if types are applied correctly
|
|
|
|
|
~
|
2014-11-05 21:26:03 +01:00
|
|
|
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Bar extends Foo { constructor() { super(function(s) { s = 5 }) } } // error, if types are applied correctly
|
|
|
|
|
~
|
2014-11-05 21:26:03 +01:00
|
|
|
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|