Skip to content

Commit 2a10511

Browse files
committed
fix(compiler-sfc): infer TSIntersectionType
fix #4294 (comment)
1 parent dbe7109 commit 2a10511

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
@@ -1976,15 +1976,14 @@ function inferRuntimeType(
19761976
case 'TSParenthesizedType':
19771977
return inferRuntimeType(node.typeAnnotation, declaredTypes)
19781978
case 'TSUnionType':
1979+
case 'TSIntersectionType':
19791980
return [
19801981
...new Set(
19811982
[].concat(
19821983
...(node.types.map(t => inferRuntimeType(t, declaredTypes)) as any)
19831984
)
19841985
)
19851986
]
1986-
case 'TSIntersectionType':
1987-
return ['Object']
19881987

19891988
case 'TSSymbolKeyword':
19901989
return ['Symbol']

0 commit comments

Comments
 (0)