mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: simplify exporting universal 'error' type
There shouldn't be any problems setting error's "Orig" (underlying) type to a separate anonymous interface, as this is already how go/types defines it. Change-Id: I44e9c4048ffe362ce329e8306632e38b5ccfecff Reviewed-on: https://go-review.googlesource.com/61790 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
261a8d9abd
commit
13772edbbd
2 changed files with 2 additions and 19 deletions
|
|
@ -385,10 +385,7 @@ func lexinit1() {
|
|||
s := builtinpkg.Lookup("error")
|
||||
types.Errortype = makeErrorInterface()
|
||||
types.Errortype.Sym = s
|
||||
// TODO: If we can prove that it's safe to set errortype.Orig here
|
||||
// than we don't need the special errortype/errorInterface case in
|
||||
// bexport.go. See also issue #15920.
|
||||
// errortype.Orig = makeErrorInterface()
|
||||
types.Errortype.Orig = makeErrorInterface()
|
||||
s.Def = asTypesNode(typenod(types.Errortype))
|
||||
|
||||
// We create separate byte and rune types for better error messages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue