Skip to content

Commit d6d16a5

Browse files
committed
fix: handle TSTypeAliasDeclaration in inferRuntimeType
1 parent 4fea167 commit d6d16a5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/compiler-sfc/src/script/resolveType.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,14 @@ export function inferRuntimeType(
15541554
case 'TSTypeReference': {
15551555
const resolved = resolveTypeReference(ctx, node, scope)
15561556
if (resolved) {
1557+
if (resolved.type === 'TSTypeAliasDeclaration') {
1558+
return inferRuntimeType(
1559+
ctx,
1560+
resolved.typeAnnotation,
1561+
resolved._ownerScope,
1562+
isKeyOf,
1563+
)
1564+
}
15571565
return inferRuntimeType(ctx, resolved, resolved._ownerScope, isKeyOf)
15581566
}
15591567

0 commit comments

Comments
 (0)