Skip to content

Conversation

@sinclairzx81
Copy link
Owner

@sinclairzx81 sinclairzx81 commented Jan 10, 2026

This PR fixes a bug introduced on 1.0.76 where TemplateLiteral normalization during Value processing would result in a StackOverflow when decoding a infinite TemplateLiteral pattern back into a TemplateLiteral.

The underlying problem is that in order to retain information about a TemplateLiteral having an infinite expansion (meaningful to the type system), that information MUST be encoded as a TemplateLiteral, but where the expectation from Value is that a decoded infinite TemplateLiteral pattern "should" return a terminating type (which would be TString)

This is a slight mismatch, so this PR introduces a TemplateLiteralDecodeUnsafe which may map TemplateLiteral -> TemplateLiteral (Identity) if the pattern is infinite. Will need to review this in later revisions.

Fixes #1510

@sinclairzx81 sinclairzx81 merged commit eea5e87 into main Jan 10, 2026
6 checks passed
@sinclairzx81 sinclairzx81 deleted the template branch January 10, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maximum call stack size exceeded when using TemplateLiteral

2 participants