Skip to content

Commit

Permalink
test: add a test case for #3782
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Jul 4, 2024
1 parent 134c411 commit ab8df96
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions test-workspace/tsc/vue2/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"../vue3/#3615",
"../vue3/#3656",
"../vue3/#3672",
"../vue3/#3782",
"../vue3/#4327",
"../vue3/components",
"../vue3/defineEmits",
Expand Down
3 changes: 3 additions & 0 deletions test-workspace/tsc/vue3.3/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
"env.d.ts",
"../vue3",
],
"exclude": [
"../vue3/#3782",
],
}
20 changes: 20 additions & 0 deletions test-workspace/tsc/vue3/#3782/main.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script setup lang="ts">
import { defineComponent } from 'vue';
export const Test = defineComponent(
<TStr extends "one" | "two", TNum extends TStr extends "one" ? 1 : 2>(props: {
str: TStr;
num: TNum;
numFn: (num: TNum) => TNum;
}) => {
return () => props.str;
}
);
</script>

<template>
<!-- val is `1` -->
<Test str="one" :num="1" :numFn="val => val" />
<!-- val is `2` -->
<Test str="two" :num="2" :numFn="val => val" />
</template>

0 comments on commit ab8df96

Please sign in to comment.