Get base primitive type for unary operators.

This commit is contained in:
Daniel Rosenwasser 2019-08-14 16:16:43 -07:00
parent cdd6b418d8
commit 3d11930453

View File

@ -24083,7 +24083,7 @@ namespace ts {
}
if (node.operator === SyntaxKind.PlusToken) {
if (maybeTypeOfKind(operandType, TypeFlags.BigIntLike)) {
error(node.operand, Diagnostics.Operator_0_cannot_be_applied_to_type_1, tokenToString(node.operator), typeToString(operandType));
error(node.operand, Diagnostics.Operator_0_cannot_be_applied_to_type_1, tokenToString(node.operator), typeToString(getBaseTypeOfLiteralType(operandType)));
}
return numberType;
}