Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/language-core/types/template-helpers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ declare global {
: T extends string ? [string, number][]
: T extends (infer U)[] ? [U, number][]
: T extends Iterable<infer V> ? [V, number][]
: [T[keyof T], `${keyof T & (string | number)}`, number][];
: [T[keyof T], keyof T extends string ? keyof T : `${keyof T & (string | number)}`, number][];
function __VLS_vSlot<S, D extends S>(slot: S, decl?: D): D extends (...args: infer P) => any ? P : any[];
function __VLS_asFunctionalDirective<T, ObjectDirective>(
dir: T,
Expand Down
23 changes: 23 additions & 0 deletions test-workspace/tsc/#5927/main.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script setup lang="ts">
import { exactType } from '../shared';

enum EnumA {
Foo = 'foo',
Bar = 'bar',
}

const enumKeyRecord: {
[key in EnumA]: string;
} = {
[EnumA.Foo]: 'a',
[EnumA.Bar]: 'b',
};
</script>

<template>
<template v-for="(row, rowIndex, index) of enumKeyRecord" :key="rowIndex">
{{ exactType(row, {} as string) }}
{{ exactType(rowIndex, {} as EnumA) }}
{{ exactType(index, {} as number) }}
</template>
</template>
4 changes: 4 additions & 0 deletions test-workspace/tsc/#5927/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.base.json",
"include": ["**/*"]
}
3 changes: 3 additions & 0 deletions test-workspace/tsc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,9 @@
{
"path": "./#5899/tsconfig.json"
},
{
"path": "./#5927/tsconfig.json"
},
{
"path": "./#625/tsconfig.json"
},
Expand Down