Tweak some code for style consistency.

This commit is contained in:
Nigel Tao committed 2017-10-19 16:51:00 +11:00
1 parent 6492c52156
commit 4b07d3cde6
1 file changed
+4 -4
+4 -4
View File
@@ -257,11 +257,11 @@ func (q *checker) tcheckAssign(n *a.Assign) error {
switch n.Operator().Key() { switch n.Operator().Key() {
case t.KeyShiftLEq, t.KeyShiftREq: case t.KeyShiftLEq, t.KeyShiftREq:
if rTyp.IsNumTypeOrIdeal() { if !rTyp.IsNumTypeOrIdeal() {
return nil return fmt.Errorf("check: assignment %q: shift %q, of type %q, does not have numeric type",
n.Operator().String(q.tm), rhs.String(q.tm), rTyp.String(q.tm))
} }
return fmt.Errorf("check: assignment %q: shift %q, of type %q, does not have numeric type", return nil
n.Operator().String(q.tm), rhs.String(q.tm), rTyp.String(q.tm))
case t.KeyTildePlusEq: case t.KeyTildePlusEq:
if !lTyp.IsUnsignedInteger() { if !lTyp.IsUnsignedInteger() {
return fmt.Errorf("check: assignment %q: %q, of type %q, does not have unsigned integer type", return fmt.Errorf("check: assignment %q: %q, of type %q, does not have unsigned integer type",