]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove unnecessary assignments while type checking.
authorTal Shprecher <tshprecher@gmail.com>
Wed, 13 Apr 2016 05:29:34 +0000 (22:29 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 13 Apr 2016 06:16:05 +0000 (06:16 +0000)
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>
src/cmd/compile/internal/gc/typecheck.go

index a20f87d940d796291a9af0a75e7bc3b48378259a..f676b9dd091957a05d2cd0e7829220c6ac0799e3 100644 (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