mirror of
https://github.com/golang/go
synced 2024-11-17 20:54:48 -07:00
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 <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>
This commit is contained in:
parent
569def31fa
commit
2a0b8cfd80
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user