File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
src/cmd/compile/internal/typecheck Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1612,6 +1612,10 @@ func checkassign(stmt ir.Node, n ir.Node) {
1612
1612
return
1613
1613
}
1614
1614
1615
+ defer n .SetType (nil )
1616
+ if n .Diag () {
1617
+ return
1618
+ }
1615
1619
switch {
1616
1620
case n .Op () == ir .ODOT && n .(* ir.SelectorExpr ).X .Op () == ir .OINDEXMAP :
1617
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 )
1626
- }
1627
-
1628
- func checkassignlist (stmt ir.Node , l ir.Nodes ) {
1629
- for _ , n := range l {
1630
- checkassign (stmt , n )
1631
- }
1632
1629
}
1633
1630
1634
1631
func checkassignto (src * types.Type , dst ir.Node ) {
You can’t perform that action at this time.
0 commit comments