TypeScript/tests/baselines/reference/genericCallWithObjectTypeArgs.errors.txt
Daniel Rosenwasser 6e77e2e810 Removed colons from diagnostic messages.
Also got rid of the 'terminalMessages' concept.
2014-10-28 00:48:58 -07:00

29 lines
1.1 KiB
Plaintext

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.
Type argument candidate 'C' is not a valid type argument because it is not a supertype of candidate 'D'.
==== 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
~~~
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
!!! error TS2453: Type argument candidate 'C' is not a valid type argument because it is not a supertype of candidate 'D'.
var r2 = foo(c1, c1); // ok