From: Matthew Dempsky Date: Fri, 18 Aug 2023 05:16:07 +0000 (-0700) Subject: cmd/compile/internal/reflectdata: remove special case for init X-Git-Tag: go1.22rc1~1212 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2a0b8cfd801077359d4483801bd5ae3b3572b314;p=gostls13.git cmd/compile/internal/reflectdata: remove special case for init 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 Run-TryBot: Matthew Dempsky TryBot-Result: Gopher Robot Reviewed-by: Dmitri Shuralyov Reviewed-by: Cuong Manh Le --- diff --git a/src/cmd/compile/internal/reflectdata/helpers.go b/src/cmd/compile/internal/reflectdata/helpers.go index f2d69cd256..1b322466ed 100644 --- a/src/cmd/compile/internal/reflectdata/helpers.go +++ b/src/cmd/compile/internal/reflectdata/helpers.go @@ -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 }