We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12a405b commit 8c22874Copy full SHA for 8c22874
src/cmd/compile/internal/typecheck/typecheck.go
@@ -1612,6 +1612,10 @@ func checkassign(stmt ir.Node, n ir.Node) {
1612
return
1613
}
1614
1615
+ defer n.SetType(nil)
1616
+ if n.Diag() {
1617
+ return
1618
+ }
1619
switch {
1620
case n.Op() == ir.ODOT && n.(*ir.SelectorExpr).X.Op() == ir.OINDEXMAP:
1621
base.Errorf("cannot assign to struct field %v in map", n)
@@ -1622,13 +1626,6 @@ func checkassign(stmt ir.Node, n ir.Node) {
1622
1626
default:
1623
1627
base.Errorf("cannot assign to %v", n)
1624
1628
1625
- n.SetType(nil)
-}
-
-func checkassignlist(stmt ir.Node, l ir.Nodes) {
1629
- for _, n := range l {
1630
- checkassign(stmt, n)
1631
- }
1632
1633
1634
func checkassignto(src *types.Type, dst ir.Node) {
0 commit comments