Skip to content

Commit bb1125a

Browse files
author
Kanchalai Tanglertsampan
committed
Do not error when spread generic type
1 parent 47bd4d3 commit bb1125a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13285,11 +13285,7 @@ namespace ts {
1328513285
attributesArray = [];
1328613286
attributesTable = createMap<Symbol>();
1328713287
}
13288-
const exprType = checkExpression(attributeDecl.expression);
13289-
if (!isValidSpreadType(exprType)) {
13290-
error(attributeDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types);
13291-
hasSpreadAnyType = true;
13292-
}
13288+
const exprType = getApparentType(checkExpression(attributeDecl.expression))
1329313289
if (isTypeAny(exprType)) {
1329413290
hasSpreadAnyType = true;
1329513291
}

0 commit comments

Comments
 (0)