From 2a0b8cfd801077359d4483801bd5ae3b3572b314 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Thu, 17 Aug 2023 22:16:07 -0700 Subject: [PATCH] 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 --- src/cmd/compile/internal/reflectdata/helpers.go | 10 ---------- 1 file changed, 10 deletions(-) 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 } -- 2.51.0