2014-10-28 08:28:59 +01:00
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgs.ts(20,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
2014-10-24 22:51:19 +02:00
Type argument candidate 'C' is not a valid type argument because it is not a supertype of candidate 'D'.
2015-01-20 23:18:22 +01:00
Types have separate declarations of a private property 'x'.
2014-10-08 22:48:44 +02:00
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgs.ts (1 errors) ====
class C {
private x: string;
}
class D {
private x: string;
}
class X<T> {
x: T;
}
function foo<T>(t: X<T>, t2: X<T>) {
var x: T;
return x;
}
var c1 = new X<C>();
var d1 = new X<D>();
var r = foo(c1, d1); // error
2014-10-22 00:32:45 +02:00
~~~
2014-10-28 08:28:59 +01:00
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
2014-10-25 01:42:22 +02:00
!!! error TS2453: Type argument candidate 'C' is not a valid type argument because it is not a supertype of candidate 'D'.
2015-01-20 23:18:22 +01:00
!!! error TS2453: Types have separate declarations of a private property 'x'.
2014-10-08 22:48:44 +02:00
var r2 = foo(c1, c1); // ok