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>
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
}