]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/reflectdata: remove special case for init
authorMatthew Dempsky <mdempsky@google.com>
Fri, 18 Aug 2023 05:16:07 +0000 (22:16 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 18 Aug 2023 22:38:01 +0000 (22:38 +0000)
Now that package initialization ordering is handled by types2 instead
of pkginit, we can get rid of this special case.

Change-Id: I4b94df02813b662498ae7d2e829119e3bb932d6e
Reviewed-on: https://go-review.googlesource.com/c/go/+/520604
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/reflectdata/helpers.go

index f2d69cd256e9e8dcd84c556beb82ed0a0494ba87..1b322466ed862c9844ccd83a2ba63c23f1e49aaf 100644 (file)
@@ -16,16 +16,6 @@ func hasRType(n, rtype ir.Node, fieldName string) bool {
                return true
        }
 
-       // We make an exception for `init`, because we still depend on
-       // pkginit for sorting package initialization statements, and it
-       // gets confused by implicit conversions. Also, because
-       // package-scope statements can never be generic, so they'll never
-       // require dictionary lookups.
-       if ir.CurFunc.Nname.Sym().Name != "init" {
-               ir.Dump("CurFunc", ir.CurFunc)
-               base.FatalfAt(n.Pos(), "missing %s in %v: %+v", fieldName, ir.CurFunc, n)
-       }
-
        return false
 }