Skip to content

Commit e829fa0

Browse files
author
Kanchalai Tanglertsampan
committed
Do not error when spread generic type
1 parent eda9133 commit e829fa0

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
@@ -13234,11 +13234,7 @@ namespace ts {
1323413234
attributesArray = [];
1323513235
attributesTable = createMap<Symbol>();
1323613236
}
13237-
const exprType = checkExpression(attributeDecl.expression);
13238-
if (!isValidSpreadType(exprType)) {
13239-
error(attributeDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types);
13240-
hasSpreadAnyType = true;
13241-
}
13237+
const exprType = getApparentType(checkExpression(attributeDecl.expression))
1324213238
if (isTypeAny(exprType)) {
1324313239
hasSpreadAnyType = true;
1324413240
}

0 commit comments

Comments
 (0)