1
0
mirror of https://github.com/golang/go synced 2024-11-23 19:30:05 -07:00

cmd/compile: remove unnecessary assignments while type checking.

Change-Id: Ica0ec84714d7f01d800d62fa10cdb08321d43cf3
Reviewed-on: https://go-review.googlesource.com/21967
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Tal Shprecher 2016-04-12 22:29:34 -07:00 committed by Matthew Dempsky
parent 6af4e996e2
commit 6531fab06f

View File

@ -338,7 +338,6 @@ OpSwitch:
ok |= Etype
if n.Type == nil {
n.Type = nil
return n
}
@ -449,7 +448,6 @@ OpSwitch:
n.Op = OTYPE
n.Type = tointerface(n.List.Slice())
if n.Type == nil {
n.Type = nil
return n
}
@ -458,7 +456,6 @@ OpSwitch:
n.Op = OTYPE
n.Type = functype(n.Left, n.List.Slice(), n.Rlist.Slice())
if n.Type == nil {
n.Type = nil
return n
}
n.Left = nil
@ -822,7 +819,6 @@ OpSwitch:
ok |= Erv
n = typecheckcomplit(n)
if n.Type == nil {
n.Type = nil
return n
}
break OpSwitch
@ -864,7 +860,6 @@ OpSwitch:
if n.Type.Etype != TFUNC || n.Type.Recv() == nil {
Yyerror("type %v has no method %v", n.Left.Type, Sconv(n.Right.Sym, FmtShort))
n.Type = nil
n.Type = nil
return n
}
@ -1961,7 +1956,6 @@ OpSwitch:
ok |= Erv
typecheckclosure(n, top)
if n.Type == nil {
n.Type = nil
return n
}
break OpSwitch