44 lines
2 KiB
Text
44 lines
2 KiB
Text
=== tests/cases/compiler/recursiveTypeComparison.ts ===
|
|
// Before fix this would take an exceeding long time to complete (#1170)
|
|
|
|
interface Observable<T> {
|
|
>Observable : Symbol(Observable, Decl(recursiveTypeComparison.ts, 0, 0))
|
|
>T : Symbol(T, Decl(recursiveTypeComparison.ts, 2, 21))
|
|
|
|
// This member can't be of type T, Property<T>, or Observable<anything but T>
|
|
needThisOne: Observable<T>;
|
|
>needThisOne : Symbol(needThisOne, Decl(recursiveTypeComparison.ts, 2, 25))
|
|
>Observable : Symbol(Observable, Decl(recursiveTypeComparison.ts, 0, 0))
|
|
>T : Symbol(T, Decl(recursiveTypeComparison.ts, 2, 21))
|
|
|
|
// Add more to make it slower
|
|
expo1: Property<T[]>; // 0.31 seconds in check
|
|
>expo1 : Symbol(expo1, Decl(recursiveTypeComparison.ts, 4, 31))
|
|
>Property : Symbol(Property, Decl(recursiveTypeComparison.ts, 9, 1))
|
|
>T : Symbol(T, Decl(recursiveTypeComparison.ts, 2, 21))
|
|
|
|
expo2: Property<T[]>; // 3.11 seconds
|
|
>expo2 : Symbol(expo2, Decl(recursiveTypeComparison.ts, 6, 25))
|
|
>Property : Symbol(Property, Decl(recursiveTypeComparison.ts, 9, 1))
|
|
>T : Symbol(T, Decl(recursiveTypeComparison.ts, 2, 21))
|
|
|
|
expo3: Property<T[]>; // 82.28 seconds
|
|
>expo3 : Symbol(expo3, Decl(recursiveTypeComparison.ts, 7, 25))
|
|
>Property : Symbol(Property, Decl(recursiveTypeComparison.ts, 9, 1))
|
|
>T : Symbol(T, Decl(recursiveTypeComparison.ts, 2, 21))
|
|
}
|
|
interface Property<T> extends Observable<T> { }
|
|
>Property : Symbol(Property, Decl(recursiveTypeComparison.ts, 9, 1))
|
|
>T : Symbol(T, Decl(recursiveTypeComparison.ts, 10, 19))
|
|
>Observable : Symbol(Observable, Decl(recursiveTypeComparison.ts, 0, 0))
|
|
>T : Symbol(T, Decl(recursiveTypeComparison.ts, 10, 19))
|
|
|
|
var p: Observable<{}>;
|
|
>p : Symbol(p, Decl(recursiveTypeComparison.ts, 12, 3))
|
|
>Observable : Symbol(Observable, Decl(recursiveTypeComparison.ts, 0, 0))
|
|
|
|
var stuck: Property<number> = p;
|
|
>stuck : Symbol(stuck, Decl(recursiveTypeComparison.ts, 13, 3))
|
|
>Property : Symbol(Property, Decl(recursiveTypeComparison.ts, 9, 1))
|
|
>p : Symbol(p, Decl(recursiveTypeComparison.ts, 12, 3))
|
|
|