2014-10-28 08:28:59 +01:00
tests/cases/compiler/typeArgumentInferenceWithConstraintAsCommonRoot.ts(7,1): 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 'Giraffe' is not a valid type argument because it is not a supertype of candidate 'Elephant'.
2015-01-20 23:18:22 +01:00
Property 'y' is missing in type 'Elephant'.
2014-10-08 22:48:44 +02:00
==== tests/cases/compiler/typeArgumentInferenceWithConstraintAsCommonRoot.ts (1 errors) ====
interface Animal { x }
interface Giraffe extends Animal { y }
interface Elephant extends Animal { z }
function f<T extends Animal>(x: T, y: T): T { return undefined; }
var g: Giraffe;
var e: Elephant;
f(g, e); // valid because both Giraffe and Elephant satisfy the constraint. T is Animal
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.
2015-01-20 23:18:22 +01:00
!!! error TS2453: Type argument candidate 'Giraffe' is not a valid type argument because it is not a supertype of candidate 'Elephant'.
!!! error TS2453: Property 'y' is missing in type 'Elephant'.