mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
33 lines
699 B
TypeScript
33 lines
699 B
TypeScript
//// [tests/cases/compiler/circularConstraintYieldsAppropriateError.ts] ////
|
|
|
|
//// [circularConstraintYieldsAppropriateError.ts]
|
|
// https://github.com/Microsoft/TypeScript/issues/16861
|
|
class BaseType<T> {
|
|
bar: T
|
|
}
|
|
|
|
class NextType<C extends { someProp: any }, T = C['someProp']> extends BaseType<T> {
|
|
baz: string;
|
|
}
|
|
|
|
class Foo extends NextType<Foo> {
|
|
someProp: {
|
|
test: true
|
|
}
|
|
}
|
|
|
|
const foo = new Foo();
|
|
foo.bar.test
|
|
|
|
//// [circularConstraintYieldsAppropriateError.js]
|
|
"use strict";
|
|
// https://github.com/Microsoft/TypeScript/issues/16861
|
|
class BaseType {
|
|
}
|
|
class NextType extends BaseType {
|
|
}
|
|
class Foo extends NextType {
|
|
}
|
|
const foo = new Foo();
|
|
foo.bar.test;
|