Describe the bug
In strip-only mode, removing a type declaration between an expression and an interpolated template literal changes the remaining code into a tagged template expression.
Input code
Config
N/A
Link to the code that reproduces this issue
https://play.swc.rs/?version=1.15.43&code=H4sIAAAAAAAAA0vjKqksSFUIUbBVMLDmSlCpNqhNsAYA3KRIuRUAAAA%3D&config=H4sIAAAAAAAAA6vmUlBQyipOVrJSqAYygZyCxKLi1CI4HyhSXJlXklgBFFEqqSxILU4uyiwoUQJL1nKBcC0AuLhMNkUAAAA%3D&strip-types=1
SWC Info output
Repository commit: 762e5d213972536fb3053a561a21a78171c19084
Expected behavior
The expression and template literal should remain separate statements:
Actual behavior
The stripped output is parsed as a tagged template expression:
Version
All
Additional context
The output is valid JavaScript, but its runtime behavior is different from the input.
Describe the bug
In
strip-onlymode, removing a type declaration between an expression and an interpolated template literal changes the remaining code into a tagged template expression.Input code
Config
N/A
Link to the code that reproduces this issue
https://play.swc.rs/?version=1.15.43&code=H4sIAAAAAAAAA0vjKqksSFUIUbBVMLDmSlCpNqhNsAYA3KRIuRUAAAA%3D&config=H4sIAAAAAAAAA6vmUlBQyipOVrJSqAYygZyCxKLi1CI4HyhSXJlXklgBFFEqqSxILU4uyiwoUQJL1nKBcC0AuLhMNkUAAAA%3D&strip-types=1
SWC Info output
Expected behavior
The expression and template literal should remain separate statements:
Actual behavior
The stripped output is parsed as a tagged template expression:
Version
All
Additional context
The output is valid JavaScript, but its runtime behavior is different from the input.