-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Exclude types originating in literals from recursion depth limiter check #34742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/compiler/checker.ts
Outdated
const symbol = type.symbol; | ||
if (symbol) { | ||
let count = 0; | ||
for (let i = 0; i < depth; i++) { | ||
const t = stack[i]; | ||
if (t.flags & TypeFlags.Object && t.symbol === symbol) { | ||
if (t.flags & TypeFlags.Object && t.symbol === symbol && !isObjectOrArrayLiteralType(t)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If two types have the same symbol and one of them is already known not to be an array or object literal type, how could the other possibly be? Under what scenarios does this need to be checked here, too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right.
@typescript-bot run dt |
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at 00570a1. You can monitor the build here. It should now contribute to this PR's status checks. |
@typescript-bot test this |
Heya @ahejlsberg, I've started to run the extended test suite on this PR at 00570a1. You can monitor the build here. It should now contribute to this PR's status checks. |
RWC tests are clean. DT tests have one new error in tests for |
Is there a case where there's an object literal type that's provided as an argument to a symbolless generic (indexed access?) thats somehow nonterminating now? |
Don't think so. But if there is, then there is now as well since literals by themselves can't be circular. |
Fixes #34619.