TypeScript/tests/cases/compiler/typeArgumentDefaultUsesConstraintOnCircularDefault.ts

12 lines
286 B
TypeScript
Raw Normal View History

2018-12-28 01:05:14 +01:00
type Test<T extends string = T> = { value: T }; // Error
let zz: Test = { foo: "abc" }; // should error on comparison with Test<string>
2018-12-28 01:05:14 +01:00
let zzy: Test = { value: {} };
// Simplified repro from #28873
class C1<T extends C1 = any> {}
class C2<T extends C2<any> = any> {}