Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/importer: receiver type of method of a named interface type loaded from exportdata is unnamed #13829

Closed
alandonovan opened this issue Jan 5, 2016 · 4 comments
Milestone

Comments

@alandonovan
Copy link
Contributor

It would be convenient for tools if the receiver of a named interface type had the named type, instead of a copy of the underlying type, which is unwieldy and loses information. There's an existing TODO in types.NewInterface to this effect.

This feature could be supported in a backward-compatible way by adding a SetReceiver(*types.TypeName) method to *types.Interface.

@alandonovan
Copy link
Contributor Author

(See Google internal issue 26331962.)

@alandonovan
Copy link
Contributor Author

See output of http://play.golang.org/p/WOgHkrUr16 (when run locally) for example:

         type fmt.Stringer interface{String() string}
                 func (interface).String() string
                         interface{String() string}   <--- ideally this would print "fmt.Stringer"

@alandonovan alandonovan changed the title go/types: methods of a named interface type loaded from exportdata are unnamed go/types: receiver type of method of a named interface type loaded from exportdata is unnamed Jan 5, 2016
@bradfitz bradfitz added this to the Unplanned milestone Jan 21, 2016
@griesemer griesemer changed the title go/types: receiver type of method of a named interface type loaded from exportdata is unnamed go/importer: receiver type of method of a named interface type loaded from exportdata is unnamed Dec 22, 2017
@griesemer griesemer modified the milestones: Unplanned, Go1.11 Dec 22, 2017
@gopherbot
Copy link

Change https://golang.org/cl/85318 mentions this issue: go/importer: use named receiver types for methods of named interfaces (gcimporter)

@gopherbot
Copy link

Change https://golang.org/cl/118555 mentions this issue: go/internal/gcimporter, gccgoimporter: updated to match latest version in std lib

gopherbot pushed a commit to golang/tools that referenced this issue Jun 13, 2018
…n in std lib

This CL brings over the changes from:

https://go-review.googlesource.com/118496 (better error message when importer is out of date)
https://go-review.googlesource.com/114317 (permit embedding of non-defined interfaces via alias type names)
https://go-review.googlesource.com/85318  (use named receiver types for methods of named interfaces)
https://go-review.googlesource.com/42870  (report import path if package is not found)
https://go-review.googlesource.com/41710  (version tests for 1.8, v4 and v5)

Also updated go/gcexportdata to select between binary and new indexed export format.

For golang/go#25856.
For golang/go#25301.
For golang/go#20230.
For golang/go#13829.

Change-Id: Ibf77c50f86e767cef411bd1d3809e12397678958
Reviewed-on: https://go-review.googlesource.com/118555
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
@golang golang locked and limited conversation to collaborators Jun 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants