2014-11-05 21:26:03 +01:00
|
|
|
tests/cases/compiler/genericTypeAssertions1.ts(3,5): error TS2322: Type 'A<number>' is not assignable to type 'A<string>'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Type 'number' is not assignable to type 'string'.
|
2014-11-05 21:26:03 +01:00
|
|
|
tests/cases/compiler/genericTypeAssertions1.ts(4,5): error TS2322: Type 'A<A<number>>' is not assignable to type 'A<number>'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Type 'A<number>' is not assignable to type 'number'.
|
2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/compiler/genericTypeAssertions1.ts(4,21): error TS2352: Neither type 'A<number>' nor type 'A<A<number>>' is assignable to the other.
|
|
|
|
Type 'number' is not assignable to type 'A<number>'.
|
2014-09-12 22:35:07 +02:00
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/genericTypeAssertions1.ts (3 errors) ====
|
|
|
|
class A<T> { foo(x: T) { }}
|
|
|
|
var foo = new A<number>();
|
|
|
|
var r: A<string> = <A<number>>new A(); // error
|
2014-07-19 02:30:06 +02:00
|
|
|
~
|
2014-11-05 21:26:03 +01:00
|
|
|
!!! error TS2322: Type 'A<number>' is not assignable to type 'A<string>'.
|
|
|
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
2014-07-13 01:04:16 +02:00
|
|
|
var r2: A<number> = <A<A<number>>>foo; // error
|
2014-07-19 02:30:06 +02:00
|
|
|
~~
|
2014-11-05 21:26:03 +01:00
|
|
|
!!! error TS2322: Type 'A<A<number>>' is not assignable to type 'A<number>'.
|
|
|
|
!!! error TS2322: Type 'A<number>' is not assignable to type 'number'.
|
2014-07-13 01:04:16 +02:00
|
|
|
~~~~~~~~~~~~~~~~~
|
2014-10-28 08:28:59 +01:00
|
|
|
!!! error TS2352: Neither type 'A<number>' nor type 'A<A<number>>' is assignable to the other.
|
2014-10-31 18:19:31 +01:00
|
|
|
!!! error TS2352: Type 'number' is not assignable to type 'A<number>'.
|