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/types: crash in assignment between "unexported" named interface types #5512

remyoudompheng opened this issue May 18, 2013 · 2 comments


Copy link

@remyoudompheng remyoudompheng commented May 18, 2013

What steps will reproduce the problem?

Typechekck the follwoing pair of files:

$ cat main.go
package blah

import "testb/pkg"

type stringer interface {
    String() string

func F() {
      var t pkg.T
    var s stringer = t.Field

$ cat pkg/pkg.go
package pkg

type stringer interface {
    String() string

type T struct {
    Field stringer

What is the expected output? What do you see instead?

Expected: no error

$ gotype .
INTERNAL PANIC: runtime error: invalid memory address or nil pointer dereference
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x10 pc=0x487765]

goroutine 1 [running]:
    /home/remy/travail/go/src/ +0xa2·003()
    /home/remy/travail/go/src/ +0x175, 0x1, 0x1,
0xc200087850, 0x1, ...)
    /home/remy/travail/go/src/ +0xe5, 0xc200064a00,
0xc200079b00, 0xc200064a40, 0x0, ...)
    /home/remy/travail/go/src/ +0x8de*operand).isAssignable(0xc2000a5cc0, 0xc2000a5480,
0xc200079b40, 0xc2000a2840, 0x0, ...)
    /home/remy/travail/go/src/ +0x172*checker).assignment(0xc20008c0b0, 0xc2000a5cc0,
0xc200079b40, 0xc2000a2840, 0x1, ...)
    /home/remy/travail/go/src/ +0x1dd*checker).assign1to1(0xc20008c0b0, 0xc2000a5040,
0xc200064660, 0xc2000a52c0, 0xc2000646e0, ...)
    /home/remy/travail/go/src/ +0x563*checker).valueSpec(0xc20008c0b0, 0x73,
0xc20007d910, 0xc2000a5c40, 0xc200000228, ...)
    /home/remy/travail/go/src/ +0x3a9*checker).object(0xc20008c0b0, 0xc20007d910,
0xc2000a5c40, 0xc2000a5c00)
    /home/remy/travail/go/src/ +0x3ca*checker).decl(0xc20008c0b0, 0xc200079f80,
    /home/remy/travail/go/src/ +0x44c*checker).stmt(0xc20008c0b0, 0xc2000a5380,
    /home/remy/travail/go/src/ +0x3108*checker).stmtList(0xc20008c0b0, 0xc200064700, 0x2,
    /home/remy/travail/go/src/ +0x68, 0x5ce2a0, 0x1, 0xc200079e40,
0xc200000240, ...)
    /home/remy/travail/go/src/ +0x4cf*Context).Check(0xc2000a5480, 0x5ce2a0, 0x1,
0xc200079e40, 0xc200000240, ...)
    /home/remy/travail/go/src/ +0x6c
main.processPackage(0xc200079e40, 0xc200000240, 0x1, 0x1)
    /home/remy/travail/go/src/ +0xd9
main.processFiles(0xc200086700, 0x2, 0x64, 0xc200000100)
    /home/remy/travail/go/src/ +0x178
main.processDirectory(0x7fff7b5d0923, 0x1)
    /home/remy/travail/go/src/ +0x24a
main.processFiles(0xc200064010, 0x1, 0x1, 0x417301)
    /home/remy/travail/go/src/ +0x1d9
    /home/remy/travail/go/src/ +0xea

goroutine 2 [runnable]:

Please use labels and text to provide additional information.
Copy link

@davecheney davecheney commented May 28, 2013

Comment 1:

Issue #5568 has been merged into this issue.


Copy link
Contributor Author

@remyoudompheng remyoudompheng commented Jul 27, 2013

Comment 2:

The issue was fixed by the fix for issue #5675 (revision eeb58a9dd66a).
The first good revision is:
changeset:   42:eeb58a9dd66a
user:        Robert Griesemer <>
date:        Tue Jun 11 10:00:00 2013 -0700
summary: fix isAssignable and IsIdentical

Status changed to Fixed.


@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.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants