Describe the bug
Optional chaining to a property named class
inside a template literal in a TypeScript script breaks the Svelte 5 parser.
Reproduction
<script lang="ts">
const str = `${obj?.class}`;
</script>
Throws Unterminated template
.
<script lang="ts">
const str = `${obj?.class} ${42}`;
</script>
Throws Unexpected token
.
Severity
blocking an upgrade