Add maxInstantiationDepth to compiler optionDeclarations #29602
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
'Bug' or 'help wanted' or is in the Community milestone
masterbranchjake runtestslocally (Had to runjake baseline-accept)Fixes #29511
The first two make sense to me, since I added a new field to the
CompilerOptionsinterface intypes.tsThe last one isn't so obvious to me and I'm not sure how I'd go about correcting this.
[EDIT]
Oh, I think it's just that I have to accept the new baseline file under
baselines/local/showConfig/Shows tsconfig for single option/maxInstantiationDepth/tsconfig.json{ "compilerOptions": { "maxInstantiationDepth": 0 } }I looked at the baseline changes and they seem okay to me. Nothing wildly different. So, I went and accepted them.
I know it's just a test with a dummy value but setting
maxInstantiationDepthto0is a bad idea =P[/EDIT]
The issue is only marked as
Needs Investigationbut I figured I'd take a stab at adding this compiler option. Being able to increase the maximum instantiation depth from50to an arbitrary value is useful for me because I seem to work with deeply nested, non-recursive, types a lot.I'm not sure how to write unit tests to test this compiler option yet but I'll try and figure it out. I figured I'd just make the PR first.
I'm not sure what
descriptionto give this compiler option, and whatcodeit would use.Do I need to add
maxInstantiationDepthtoprotocol.ts > CompilerOptions, too?I'm also unsure what else I might be missing.
While
I haven't written a unit test for this compiler option, I've tested it against a project I'm working on and it seems to work.jake runtestsfails andWithout setting
maxInstantiationDepth, compiling my project fails, settingmaxInstantiationDepthto74lets it compile successfully.I realize this PR has a bunch of problems but I'm out of my depth (No pun intended).