Fix associative op const-value calculation

This commit is contained in:
Nigel Tao committed 2020-02-08 14:54:00 +11:00
1 parent 8d29cb15ce
commit fb9a0964a2
4 files changed
+84 -9

No files matched your search

+1 -1
View File
@@ -340,7 +340,7 @@ var errFailed = errors.New("failed")
func proveReasonRequirement(q *checker, op t.ID, lhs *a.Expr, rhs *a.Expr) error {
if !op.IsXBinaryOp() {
return fmt.Errorf(
"check: internal error: proveReasonRequirement token (0x%02X) is not an XBinaryOp", op)
"check: internal error: proveReasonRequirement token (0x%X) is not an XBinaryOp", op)
}
if err := q.proveBinaryOp(op, lhs, rhs); err != nil {
n := a.NewExpr(0, op, 0, 0, lhs.AsNode(), nil, rhs.AsNode(), nil)