13 lines
292 B
TypeScript
13 lines
292 B
TypeScript
//// [typeParameterAssignmentWithConstraints.ts]
|
|
function f<A, B extends A>() {
|
|
var a: A;
|
|
var b: B;
|
|
a = b; // Error: Can't convert B to A
|
|
}
|
|
|
|
//// [typeParameterAssignmentWithConstraints.js]
|
|
function f() {
|
|
var a;
|
|
var b;
|
|
a = b; // Error: Can't convert B to A
|
|
}
|