-
-
Notifications
You must be signed in to change notification settings - Fork 212
Closed
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working
Description
Describe the bug
I have a component like this:
<script lang="ts">
import Bar from "./Bar.svelte";
import { writable } from "svelte/store";
const currentTab = writable(0);
const barIcons = ["telescope", "results", "results"];
import Inputs from "./Inputs.svelte";
const tabs = [Inputs];
</script>
<main>
<Bar bind:current={$currentTab} icons={barIcons} />
<svelte:component this={tabs[$currentTab]} />
</main>
svelte-language-server detects a TypeScript error in <svelte:component this={tabs[$currentTab]} />
:
Cannot find name '$currentTab'. Did you mean 'currentTab'?
Although it compiles without any errors or warnings.
What's interesting, if I add "+ 0" or even "+" near $currentTab, svelte-language-server will detect no error.
<svelte:component this={tabs[+$currentTab]} />
Expected behavior
No errors must be detected.
System (please complete the following information):
- OS: Arch Linux
- IDE: nvim with coc-svelte
Metadata
Metadata
Assignees
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working