mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
37 lines
761 B
TypeScript
37 lines
761 B
TypeScript
//// [tests/cases/compiler/classVarianceResolveCircularity2.ts] ////
|
|
|
|
//// [classVarianceResolveCircularity2.ts]
|
|
// Issue #52813
|
|
|
|
export {};
|
|
|
|
class Bar<T> {
|
|
num!: number;
|
|
Value = callme(new Foo(this)).bar.num;
|
|
Field: number = callme(new Foo(this)).bar.num;
|
|
}
|
|
declare function callme(x: Foo<any>): Foo<any>;
|
|
declare function callme(x: object): string;
|
|
|
|
class Foo<T> {
|
|
bar!: Bar<T>;
|
|
constructor(bar: Bar<T>) {
|
|
this.bar = bar;
|
|
}
|
|
}
|
|
|
|
//// [classVarianceResolveCircularity2.js]
|
|
// Issue #52813
|
|
class Bar {
|
|
constructor() {
|
|
this.Value = callme(new Foo(this)).bar.num;
|
|
this.Field = callme(new Foo(this)).bar.num;
|
|
}
|
|
}
|
|
class Foo {
|
|
constructor(bar) {
|
|
this.bar = bar;
|
|
}
|
|
}
|
|
export {};
|