1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
=== tests/cases/compiler/circularConstraintYieldsAppropriateError.ts ===
// https://github.com/Microsoft/TypeScript/issues/16861
class BaseType<T> {
>BaseType : Symbol(BaseType, Decl(circularConstraintYieldsAppropriateError.ts, 0, 0))
>T : Symbol(T, Decl(circularConstraintYieldsAppropriateError.ts, 1, 15))
bar: T
>bar : Symbol(BaseType.bar, Decl(circularConstraintYieldsAppropriateError.ts, 1, 19))
>T : Symbol(T, Decl(circularConstraintYieldsAppropriateError.ts, 1, 15))
}
class NextType<C extends { someProp: any }, T = C['someProp']> extends BaseType<T> {
>NextType : Symbol(NextType, Decl(circularConstraintYieldsAppropriateError.ts, 3, 1))
>C : Symbol(C, Decl(circularConstraintYieldsAppropriateError.ts, 5, 15))
>someProp : Symbol(someProp, Decl(circularConstraintYieldsAppropriateError.ts, 5, 26))
>T : Symbol(T, Decl(circularConstraintYieldsAppropriateError.ts, 5, 43))
>C : Symbol(C, Decl(circularConstraintYieldsAppropriateError.ts, 5, 15))
>BaseType : Symbol(BaseType, Decl(circularConstraintYieldsAppropriateError.ts, 0, 0))
>T : Symbol(T, Decl(circularConstraintYieldsAppropriateError.ts, 5, 43))
baz: string;
>baz : Symbol(NextType.baz, Decl(circularConstraintYieldsAppropriateError.ts, 5, 84))
}
class Foo extends NextType<Foo> {
>Foo : Symbol(Foo, Decl(circularConstraintYieldsAppropriateError.ts, 7, 1))
>NextType : Symbol(NextType, Decl(circularConstraintYieldsAppropriateError.ts, 3, 1))
>Foo : Symbol(Foo, Decl(circularConstraintYieldsAppropriateError.ts, 7, 1))
someProp: {
>someProp : Symbol(Foo.someProp, Decl(circularConstraintYieldsAppropriateError.ts, 9, 33))
test: true
>test : Symbol(test, Decl(circularConstraintYieldsAppropriateError.ts, 10, 15))
}
}
const foo = new Foo();
>foo : Symbol(foo, Decl(circularConstraintYieldsAppropriateError.ts, 15, 5))
>Foo : Symbol(Foo, Decl(circularConstraintYieldsAppropriateError.ts, 7, 1))
foo.bar.test
>foo.bar.test : Symbol(test, Decl(circularConstraintYieldsAppropriateError.ts, 10, 15))
>foo.bar : Symbol(BaseType.bar, Decl(circularConstraintYieldsAppropriateError.ts, 1, 19))
>foo : Symbol(foo, Decl(circularConstraintYieldsAppropriateError.ts, 15, 5))
>bar : Symbol(BaseType.bar, Decl(circularConstraintYieldsAppropriateError.ts, 1, 19))
>test : Symbol(test, Decl(circularConstraintYieldsAppropriateError.ts, 10, 15))
|