Skip to content

Commit 958bbff

Browse files
committed
fix(compiler-sfc): infer TSIntersectionType
fix #4294 (comment)
1 parent 0fbc19f commit 958bbff

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
@@ -1967,15 +1967,14 @@ function inferRuntimeType(
19671967
case 'TSParenthesizedType':
19681968
return inferRuntimeType(node.typeAnnotation, declaredTypes)
19691969
case 'TSUnionType':
1970+
case 'TSIntersectionType':
19701971
return [
19711972
...new Set(
19721973
[].concat(
19731974
...(node.types.map(t => inferRuntimeType(t, declaredTypes)) as any)
19741975
)
19751976
)
19761977
]
1977-
case 'TSIntersectionType':
1978-
return ['Object']
19791978

19801979
case 'TSSymbolKeyword':
19811980
return ['Symbol']

0 commit comments

Comments
 (0)