Skip to content

Commit

Permalink
chore: add test for #3311
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed May 13, 2024
1 parent b267241 commit e984392
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test-workspace/tsc/vue3/#3311/component.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
type SwitchByBoolean<T extends boolean, V> = false extends T ? V : V[];
</script>

<script lang="ts" setup generic="T extends boolean, V extends SwitchByBoolean<T, string>">
defineProps<{
modelValue?: V;
multiple?: T;
}>();
</script>
12 changes: 12 additions & 0 deletions test-workspace/tsc/vue3/#3311/main.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template>
<HelloWorld :multiple="true" :modelValue="['a']" />
<HelloWorld :multiple="false" :modelValue="'a'" />
<!-- @vue-expect-error -->
<HelloWorld :multiple="false" :modelValue="['a']" />
<!-- @vue-expect-error -->
<HelloWorld :multiple="true" :modelValue="'a'" />
</template>

<script lang="ts" setup>
import HelloWorld from './component.vue'
</script>

0 comments on commit e984392

Please sign in to comment.