-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHigh Priority
Milestone
Description
(1.5 beta)
This is the most I can reduce it while still having it crash:
class Module {
public members: Class[];
}
class Namespace {
public members: (Class | Property)[];
}
class Class {
public parent: Namespace;
}
class Property {
public parent: Module | Class;
}
var t: Class | Property;
t.toString();
tsc foo.ts -t es5
G:\src\libjass\node_modules\typescript\bin\tsc.js:0
(function (exports, require, module, __filename, __dirname) { /*! ************
^
RangeError: Maximum call stack size exceeded
at isRelatedTo (G:\src\libjass\node_modules\typescript\bin\tsc.js)
at unionTypeRelatedToType (G:\src\libjass\node_modules\typescript\bin\tsc.js:11862:35)
at isRelatedTo (G:\src\libjass\node_modules\typescript\bin\tsc.js:11787:42)
at stringIndexTypesRelatedTo (G:\src\libjass\node_modules\typescript\bin\tsc.js:12195:35)
at objectTypeRelatedTo (G:\src\libjass\node_modules\typescript\bin\tsc.js:11955:43)
at isRelatedTo (G:\src\libjass\node_modules\typescript\bin\tsc.js:11811:34)
at propertiesRelatedTo (G:\src\libjass\node_modules\typescript\bin\tsc.js:12042:43)
at objectTypeRelatedTo (G:\src\libjass\node_modules\typescript\bin\tsc.js:11949:30)
at isRelatedTo (G:\src\libjass\node_modules\typescript\bin\tsc.js:11811:34)
at typeRelatedToUnionType (G:\src\libjass\node_modules\typescript\bin\tsc.js:11850:35)
Alternative call stack for the crash (same code):
G:\src\libjass\node_modules\typescript\bin\tsc.js:11929
sourceStack = [];
^
RangeError: Maximum call stack size exceeded
at objectTypeRelatedTo (G:\src\libjass\node_modules\typescript\bin\tsc.js:11929:21)
at isRelatedTo (G:\src\libjass\node_modules\typescript\bin\tsc.js:11811:34)
at checkTypeRelatedTo (G:\src\libjass\node_modules\typescript\bin\tsc.js:11723:26)
at checkTypeSubtypeOf (G:\src\libjass\node_modules\typescript\bin\tsc.js:11703:20)
at isTypeSubtypeOf (G:\src\libjass\node_modules\typescript\bin\tsc.js:11697:20)
at isSubtypeOfAny (G:\src\libjass\node_modules\typescript\bin\tsc.js:11363:43)
at removeSubtypes (G:\src\libjass\node_modules\typescript\bin\tsc.js:11373:21)
at getUnionType (G:\src\libjass\node_modules\typescript\bin\tsc.js:11410:17)
at getReducedTypeOfUnionType (G:\src\libjass\node_modules\typescript\bin\tsc.js:11426:36)
at getApparentType (G:\src\libjass\node_modules\typescript\bin\tsc.js:10824:24)
The original code from which this test case is derived is here.
Edit: Reduced the case some more - removed the fullName
getters and simplified the types of member
.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHigh Priority