Closed
Description
Describe the bug
This code in the typescript block of a svelte component fails:
const increment = ({ increment } : { increment?: number } = {}) => {
count += 1
}
with error Assigning to rvalue svelte(js_parse_error)
Workarounds:
- Removing the default object
- Removing the destructuring:
(params: { increment?: number } = {})
- Removing the type annotation:
({ increment } = {})
Reproduction
https://stackblitz.com/edit/vitejs-vite-dcqkxf?file=src%2Flib%2FCounter.svelte%3AL7
Logs
No response
System Info
Latest Svelte 5 version
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels