forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move recursion limiter to individual resolve* functions
- Loading branch information
Showing
10 changed files
with
231 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
tests/baselines/reference/mutuallyRecursiveInference.errors.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,51 @@ | ||
//// [mutuallyRecursiveInference.ts] | ||
interface T<A> { a: A } | ||
interface L<RT> extends T<RT['a']> {} | ||
interface X extends L<X> {} | ||
class T<A> { | ||
a: A; | ||
b: any | ||
} | ||
class L<RT extends { a: 'a' | 'b', b: any }> extends T<RT[RT['a']]> { | ||
m() { this.a } | ||
} | ||
class X extends L<X> { | ||
a: 'a' | 'b' | ||
b: number | ||
m2() { | ||
this.a | ||
} | ||
} | ||
|
||
|
||
//// [mutuallyRecursiveInference.js] | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var T = /** @class */ (function () { | ||
function T() { | ||
} | ||
return T; | ||
}()); | ||
var L = /** @class */ (function (_super) { | ||
__extends(L, _super); | ||
function L() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
L.prototype.m = function () { this.a; }; | ||
return L; | ||
}(T)); | ||
var X = /** @class */ (function (_super) { | ||
__extends(X, _super); | ||
function X() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
X.prototype.m2 = function () { | ||
this.a; | ||
}; | ||
return X; | ||
}(L)); |
54 changes: 42 additions & 12 deletions
54
tests/baselines/reference/mutuallyRecursiveInference.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,48 @@ | ||
=== tests/cases/compiler/mutuallyRecursiveInference.ts === | ||
interface T<A> { a: A } | ||
class T<A> { | ||
>T : Symbol(T, Decl(mutuallyRecursiveInference.ts, 0, 0)) | ||
>A : Symbol(A, Decl(mutuallyRecursiveInference.ts, 0, 12)) | ||
>a : Symbol(T.a, Decl(mutuallyRecursiveInference.ts, 0, 16)) | ||
>A : Symbol(A, Decl(mutuallyRecursiveInference.ts, 0, 12)) | ||
>A : Symbol(A, Decl(mutuallyRecursiveInference.ts, 0, 8)) | ||
|
||
interface L<RT> extends T<RT['a']> {} | ||
>L : Symbol(L, Decl(mutuallyRecursiveInference.ts, 0, 23)) | ||
>RT : Symbol(RT, Decl(mutuallyRecursiveInference.ts, 1, 12)) | ||
a: A; | ||
>a : Symbol(T.a, Decl(mutuallyRecursiveInference.ts, 0, 12)) | ||
>A : Symbol(A, Decl(mutuallyRecursiveInference.ts, 0, 8)) | ||
|
||
b: any | ||
>b : Symbol(T.b, Decl(mutuallyRecursiveInference.ts, 1, 9)) | ||
} | ||
class L<RT extends { a: 'a' | 'b', b: any }> extends T<RT[RT['a']]> { | ||
>L : Symbol(L, Decl(mutuallyRecursiveInference.ts, 3, 1)) | ||
>RT : Symbol(RT, Decl(mutuallyRecursiveInference.ts, 4, 8)) | ||
>a : Symbol(a, Decl(mutuallyRecursiveInference.ts, 4, 20)) | ||
>b : Symbol(b, Decl(mutuallyRecursiveInference.ts, 4, 34)) | ||
>T : Symbol(T, Decl(mutuallyRecursiveInference.ts, 0, 0)) | ||
>RT : Symbol(RT, Decl(mutuallyRecursiveInference.ts, 1, 12)) | ||
>RT : Symbol(RT, Decl(mutuallyRecursiveInference.ts, 4, 8)) | ||
>RT : Symbol(RT, Decl(mutuallyRecursiveInference.ts, 4, 8)) | ||
|
||
m() { this.a } | ||
>m : Symbol(L.m, Decl(mutuallyRecursiveInference.ts, 4, 69)) | ||
>this.a : Symbol(T.a, Decl(mutuallyRecursiveInference.ts, 0, 12)) | ||
>this : Symbol(L, Decl(mutuallyRecursiveInference.ts, 3, 1)) | ||
>a : Symbol(T.a, Decl(mutuallyRecursiveInference.ts, 0, 12)) | ||
} | ||
class X extends L<X> { | ||
>X : Symbol(X, Decl(mutuallyRecursiveInference.ts, 6, 1)) | ||
>L : Symbol(L, Decl(mutuallyRecursiveInference.ts, 3, 1)) | ||
>X : Symbol(X, Decl(mutuallyRecursiveInference.ts, 6, 1)) | ||
|
||
a: 'a' | 'b' | ||
>a : Symbol(X.a, Decl(mutuallyRecursiveInference.ts, 7, 22)) | ||
|
||
b: number | ||
>b : Symbol(X.b, Decl(mutuallyRecursiveInference.ts, 8, 16)) | ||
|
||
m2() { | ||
>m2 : Symbol(X.m2, Decl(mutuallyRecursiveInference.ts, 9, 13)) | ||
|
||
interface X extends L<X> {} | ||
>X : Symbol(X, Decl(mutuallyRecursiveInference.ts, 1, 37)) | ||
>L : Symbol(L, Decl(mutuallyRecursiveInference.ts, 0, 23)) | ||
>X : Symbol(X, Decl(mutuallyRecursiveInference.ts, 1, 37)) | ||
this.a | ||
>this.a : Symbol(X.a, Decl(mutuallyRecursiveInference.ts, 7, 22)) | ||
>this : Symbol(X, Decl(mutuallyRecursiveInference.ts, 6, 1)) | ||
>a : Symbol(X.a, Decl(mutuallyRecursiveInference.ts, 7, 22)) | ||
} | ||
} | ||
|
40 changes: 35 additions & 5 deletions
40
tests/baselines/reference/mutuallyRecursiveInference.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,48 @@ | ||
=== tests/cases/compiler/mutuallyRecursiveInference.ts === | ||
interface T<A> { a: A } | ||
class T<A> { | ||
>T : T<A> | ||
>A : A | ||
|
||
a: A; | ||
>a : A | ||
>A : A | ||
|
||
interface L<RT> extends T<RT['a']> {} | ||
b: any | ||
>b : any | ||
} | ||
class L<RT extends { a: 'a' | 'b', b: any }> extends T<RT[RT['a']]> { | ||
>L : L<RT> | ||
>RT : RT | ||
>T : T<A> | ||
>a : "a" | "b" | ||
>b : any | ||
>T : T<RT[RT["a"]]> | ||
>RT : RT | ||
>RT : RT | ||
|
||
interface X extends L<X> {} | ||
m() { this.a } | ||
>m : () => void | ||
>this.a : RT[RT["a"]] | ||
>this : this | ||
>a : RT[RT["a"]] | ||
} | ||
class X extends L<X> { | ||
>X : X | ||
>L : L<RT> | ||
>L : L<X> | ||
>X : X | ||
|
||
a: 'a' | 'b' | ||
>a : "a" | "b" | ||
|
||
b: number | ||
>b : number | ||
|
||
m2() { | ||
>m2 : () => void | ||
|
||
this.a | ||
>this.a : "a" | "b" | ||
>this : this | ||
>a : "a" | "b" | ||
} | ||
} | ||
|
Oops, something went wrong.