Skip to content

Rest parameters in a snippet should be a compile error #12464

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Rich-Harris opened this issue Jul 16, 2024 · 2 comments · Fixed by #12472
Closed

Rest parameters in a snippet should be a compile error #12464

Rich-Harris opened this issue Jul 16, 2024 · 2 comments · Fixed by #12472
Labels
Milestone

Comments

@Rich-Harris
Copy link
Member

Describe the bug

We error on this...

{#snippet a(b)}
  {b}
{/snippet}

{@render a(...[1])}

...but not this:

{#snippet a(...b)}
  {b[0]}
{/snippet}

{@render a(1)}

Instead, it fails cryptically at runtime.

Reproduction

see above

Logs

No response

System Info

next

Severity

annoyance

@Rich-Harris Rich-Harris added this to the 5.0 milestone Jul 16, 2024
@FoHoOV
Copy link
Contributor

FoHoOV commented Jul 16, 2024

Can't svelte allow snippets to fully support rest params?

@Conduitry
Copy link
Member

Perhaps at some point. There's an issue for it post-5.0 - #11178

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants