Skip to content

Compiler shouldn't allow named slots other than at top level inside component #3385

@Conduitry

Description

@Conduitry

Describe the bug
The compiler permits inline components containing named slots that appear inside other elements inside the component. I don't think this means anything or should be allowed. The currently produced code does not behave well.

To Reproduce

<script>
	import Wrapper from './Wrapper.svelte';
</script>

<Wrapper>
	<div>
		<div slot='foo'>
		</div>
	</div>
</Wrapper>

Expected behavior
The compiler throws an exception and refuses to compile this.

Severity
Low

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions