2014-07-13 01:04:16 +02:00
|
|
|
//// [primitiveConstraints1.ts]
|
|
|
|
function foo1<T extends U, U>(t: T, u: U) { }
|
|
|
|
foo1<string, number>('hm', 1); // no error
|
|
|
|
|
|
|
|
function foo2<T, U extends T>(t: T, u: U) { }
|
|
|
|
foo2<number, string>(1, 'hm'); // error
|
|
|
|
|
|
|
|
|
|
|
|
//// [primitiveConstraints1.js]
|
2015-02-07 03:45:09 +01:00
|
|
|
function foo1(t, u) { }
|
2014-08-16 00:49:09 +02:00
|
|
|
foo1('hm', 1); // no error
|
2015-02-07 03:45:09 +01:00
|
|
|
function foo2(t, u) { }
|
2014-08-16 00:49:09 +02:00
|
|
|
foo2(1, 'hm'); // error
|