NodeList *ll, *lr;
Type *t;
Sym *s;
- int et, cl, cr, typeok;
+ int et, cl, cr, typeok, op;
int32 lno;
if(n == N)
* ======== second switch ========
*/
- switch(n->op) {
+ op = n->op;
+ if(op == OASOP)
+ op = n->etype;
+ switch(op) {
default:
fatal("walkexpr: switch 2 unknown op %N", n, init);
goto ret;
badtype(n->op, n->left->type, T);
goto ret;
}
- badtype(n->op, n->left->type, n->right->type);
+ op = n->op;
+ if(op == OASOP)
+ op = n->etype;
+ badtype(op, n->left->type, n->right->type);
goto ret;
ret:
--- /dev/null
+// errchk $G $D/$F.go
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func f() {
+ a := true;
+ a |= a; // ERROR "illegal.*OR"
+}