TypeScript/tests/baselines/reference/recursiveTypeInGenericConstraint.js
Sheetal Nandi 6ab3adfd43 Modified the emitComment logic to handle emitting leading or trailing spaces depending on flags
Leading comments have trailing separator while trailing comments have leading space
This removes the extra trailing space in the trailing comments
2014-08-15 14:32:08 -07:00

33 lines
677 B
TypeScript

//// [recursiveTypeInGenericConstraint.ts]
class G<T> {
x: G<G<T>>; // infinitely expanding type reference
}
class Foo<T extends G<T>> { // error, constraint referencing itself
bar: T;
}
class D<T> {
x: G<G<T>>;
}
var c1 = new Foo<D<string>>(); // ok, circularity in assignment compat check causes success
//// [recursiveTypeInGenericConstraint.js]
var G = (function () {
function G() {
}
return G;
})();
var Foo = (function () {
function Foo() {
}
return Foo;
})();
var D = (function () {
function D() {
}
return D;
})();
var c1 = new Foo(); // ok, circularity in assignment compat check causes success