Skip to content

fix(plugin): avoid undefined type parameter references when assert=false#296

Open
ncthuc2004 wants to merge 1 commit into
gajus:masterfrom
ncthuc2004:issuehunt-180-assert-false-typeparam
Open

fix(plugin): avoid undefined type parameter references when assert=false#296
ncthuc2004 wants to merge 1 commit into
gajus:masterfrom
ncthuc2004:issuehunt-180-assert-false-typeparam

Conversation

@ncthuc2004
Copy link
Copy Markdown

@ncthuc2004 ncthuc2004 commented May 14, 2026

Summary

  • skip typed variable helper generation when assert / warn checks are disabled
  • add regression fixture for <X> let bar: X under assert:false transform mode

Why

With assert:false, the plugin still emitted helper bindings like let _barType = X in function scope, but X was only declared inside annotation wrappers. This caused runtime X is undefined errors.

Closes #180


IssueHunt Summary

Referenced issues

This pull request has been submitted to:


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.

babel-plugin-flow-runtime references undefined type parameter names with assertions disabled

1 participant