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

cmd/gc: corruption of embedded fields in cross-package inlining #6153

Closed
rogpeppe opened this issue Aug 15, 2013 · 2 comments
Closed

cmd/gc: corruption of embedded fields in cross-package inlining #6153

rogpeppe opened this issue Aug 15, 2013 · 2 comments
Milestone

Comments

@rogpeppe
Copy link
Contributor

1. What is a short input program that triggers the error?
package foo
type Foo interface {
    X()
}
func Test(f Foo) {
    _ = f.(struct{Foo})
}

package main
import (
    "local/foo"
)

func main() {
    foo.Test(nil)
}


2. What is the full compiler output?
./tst.go:3: impossible type assertion:
    struct {} does not implement foo.Foo (missing X method)
./tst.go:7: internal compiler error: typename <T>


3. What version of the compiler are you using?  (Run it with the -V flag.)

6g version go1.1.2

This might be the same as issue #5974.
@rogpeppe
Copy link
Contributor Author

Comment 1:

For the record, it doesn't fail with inlining disabled, or if Test is not inlined for
some other reason.

@remyoudompheng
Copy link
Contributor

Comment 2:

This is issue #5910, it's fixed at tip. issue #5910 remains open for the special case of
embedded builtins which is still broken.
See revision 56696c13acef.

Status changed to Duplicate.

Merged into issue #5910.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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