-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
Bug Report
π Search Terms
RangeError: Maximum call stack size exceeded
π Version & Regression Information
5.1.0-dev.20230414
β― Playground Link
Playground link with relevant code
(check the console for the error)
π» Code
type LengthDown<
Str extends string,
Length extends number | bigint,
It
> = It extends StrIter.Iterator
? StrIter.CutAt<Str, It> extends `${infer $Rest}`
? LengthDown<$Rest, Add<Length, StrIter.Value<It>>, It>
: LengthDown<Str, Length, StrIter.Prev<It>>
: Length;
π Actual behavior
> tsc --noEmit --moduleresolution nodenext
C:\Users\user\hotscript\node_modules\typescript\lib\tsc.js:114339
throw e;
^
RangeError: Maximum call stack size exceeded
at String.replace (<anonymous>)
at formatStringFromArgs (C:\Users\user\hotscript\node_modules\typescript\lib\tsc.js:15925:15)
at createFileDiagnostic (C:\Users\user\hotscript\node_modules\typescript\lib\tsc.js:15999:12)
at createDiagnosticForNodeInSourceFile (C:\Users\user\hotscript\node_modules\typescript\lib\tsc.js:12335:10)
at createDiagnosticForNode (C:\Users\user\hotscript\node_modules\typescript\lib\tsc.js:12327:10)
at createError (C:\Users\user\hotscript\node_modules\typescript\lib\tsc.js:43554:23)
at error (C:\Users\user\hotscript\node_modules\typescript\lib\tsc.js:43557:24)
at C:\Users\user\hotscript\node_modules\typescript\lib\tsc.js:44396:15
at addLazyDiagnostic (C:\Users\user\hotscript\node_modules\typescript\lib\tsc.js:79812:33)
at resolveNameHelper (C:\Users\user\hotscript\node_modules\typescript\lib\tsc.js:44359:9)
π Expected behavior
no crash
DetachHead and KotlinIsland
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFix AvailableA PR has been opened for this issueA PR has been opened for this issue