Commit 6531fab0 authored by Tal Shprecher's avatar Tal Shprecher Committed by Matthew Dempsky

cmd/compile: remove unnecessary assignments while type checking.

Change-Id: Ica0ec84714d7f01d800d62fa10cdb08321d43cf3
Reviewed-on: https://go-review.googlesource.com/21967Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent 6af4e996
...@@ -338,7 +338,6 @@ OpSwitch: ...@@ -338,7 +338,6 @@ OpSwitch:
ok |= Etype ok |= Etype
if n.Type == nil { if n.Type == nil {
n.Type = nil
return n return n
} }
...@@ -449,7 +448,6 @@ OpSwitch: ...@@ -449,7 +448,6 @@ OpSwitch:
n.Op = OTYPE n.Op = OTYPE
n.Type = tointerface(n.List.Slice()) n.Type = tointerface(n.List.Slice())
if n.Type == nil { if n.Type == nil {
n.Type = nil
return n return n
} }
...@@ -458,7 +456,6 @@ OpSwitch: ...@@ -458,7 +456,6 @@ OpSwitch:
n.Op = OTYPE n.Op = OTYPE
n.Type = functype(n.Left, n.List.Slice(), n.Rlist.Slice()) n.Type = functype(n.Left, n.List.Slice(), n.Rlist.Slice())
if n.Type == nil { if n.Type == nil {
n.Type = nil
return n return n
} }
n.Left = nil n.Left = nil
...@@ -822,7 +819,6 @@ OpSwitch: ...@@ -822,7 +819,6 @@ OpSwitch:
ok |= Erv ok |= Erv
n = typecheckcomplit(n) n = typecheckcomplit(n)
if n.Type == nil { if n.Type == nil {
n.Type = nil
return n return n
} }
break OpSwitch break OpSwitch
...@@ -864,7 +860,6 @@ OpSwitch: ...@@ -864,7 +860,6 @@ OpSwitch:
if n.Type.Etype != TFUNC || n.Type.Recv() == nil { if n.Type.Etype != TFUNC || n.Type.Recv() == nil {
Yyerror("type %v has no method %v", n.Left.Type, Sconv(n.Right.Sym, FmtShort)) Yyerror("type %v has no method %v", n.Left.Type, Sconv(n.Right.Sym, FmtShort))
n.Type = nil n.Type = nil
n.Type = nil
return n return n
} }
...@@ -1961,7 +1956,6 @@ OpSwitch: ...@@ -1961,7 +1956,6 @@ OpSwitch:
ok |= Erv ok |= Erv
typecheckclosure(n, top) typecheckclosure(n, top)
if n.Type == nil { if n.Type == nil {
n.Type = nil
return n return n
} }
break OpSwitch break OpSwitch
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment