Skip to content

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

New issue

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

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

Already on GitHub? Sign in 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

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

Successfully merging a pull request may close this issue.

3 participants