Skip to content

Commit a3721e1

Browse files
committed
fix(compiler-sfc): infer TSIntersectionType
fix #4294 (comment)
1 parent 3a7572c commit a3721e1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/compiler-sfc/src/compileScript.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,15 +2069,14 @@ function inferRuntimeType(
20692069
case 'TSParenthesizedType':
20702070
return inferRuntimeType(node.typeAnnotation, declaredTypes)
20712071
case 'TSUnionType':
2072+
case 'TSIntersectionType':
20722073
return [
20732074
...new Set(
20742075
[].concat(
20752076
...(node.types.map(t => inferRuntimeType(t, declaredTypes)) as any)
20762077
)
20772078
)
20782079
]
2079-
case 'TSIntersectionType':
2080-
return ['Object']
20812080

20822081
case 'TSSymbolKeyword':
20832082
return ['Symbol']

0 commit comments

Comments
 (0)