File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
packages/language-core/lib/codegen
test-workspace/tsc/passedFixtures/vue3/#5474 Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ export function generateGlobalTypes({
164
164
index: number,
165
165
][];
166
166
function __VLS_getSlotParameters<S, D extends S>(slot: S, decl?: D):
167
- __VLS_PickNotAny<NonNullable<D>, (...args: any) => any> extends (...args: infer P) => any ? P : any[];
167
+ D extends (...args: infer P) => any ? P : any[];
168
168
function __VLS_asFunctionalDirective<T>(dir: T): T extends import('${ lib } ').ObjectDirective
169
169
? NonNullable<T['created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted']>
170
170
: T extends (...args: any) => any
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ function* generateSlotParameters(
154
154
nextStart = end ;
155
155
}
156
156
yield chunk ( nextStart , expression . equalsGreaterThanToken . pos - 1 ) ;
157
- yield `] = __VLS_getSlotParameters(${ slotVar } ` ;
157
+ yield `] = __VLS_getSlotParameters(${ slotVar } ! ` ;
158
158
159
159
if ( types . some ( t => t ) ) {
160
160
yield `, ` ;
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ import { exactType } from ' ../../shared' ;
3
+
4
+ type Foo = { foo: string };
5
+ type Bar = { bar: string };
6
+
7
+ declare const Comp: (props : {}, ctx : { slots: {
8
+ foo: (props : Foo ) => void ;
9
+ bar: (props : Bar ) => void ;
10
+ } }) => {};
11
+ </script >
12
+
13
+ <template >
14
+ <Comp >
15
+ <template v-for =" name in ([' foo' , ' bar' ] as const )" #[name ]=" props " >
16
+ {{ exactType(props, {} as Foo | Bar) }}
17
+ </template >
18
+ </Comp >
19
+ </template >
You can’t perform that action at this time.
0 commit comments