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

Meaningless error message (related to type assertion at global scope) #915

Closed
nsf opened this issue Jul 12, 2010 · 2 comments
Closed

Meaningless error message (related to type assertion at global scope) #915

nsf opened this issue Jul 12, 2010 · 2 comments

Comments

@nsf
Copy link

nsf commented Jul 12, 2010

Code:
-------------------------------------------------------------
package main

type MyInterface interface {
}

type My struct {
    a, b, c int
}

var my = &My{1,2,3}
var myInterface MyInterface = my
var origMy, ok = myInterface.(*My)

func main() {
}
-------------------------------------------------------------

Compilation gives:
-------------------------------------------------------------
[nsf @ waytogo]$ 8g test.go
defn [9f9cbc0]
.   AS2DOTTYPE l(12) x(-1000000000) tc(1)
.   AS2DOTTYPE-list
.   .   NAME-origMy G0 u(1) a(1) l(12) class(1) tc(1) *My
.   .   NAME-ok G0 u(1) a(1) l(12) class(1) tc(1) bool
.   AS2DOTTYPE-rlist
.   .   DOTTYPE2 l(12) x(-1000000000) tc(1) *My
.   .   .   NAME-myInterface G0 u(1) a(1) l(11) class(1) tc(1) MyInterface
test.go:15: internal compiler error: init1: bad defn
-------------------------------------------------------------

Compiler/machine spec:
linux, 386, b761e0299e9b release/release.2010-07-01

Even if it's not a legal declaration, good error message is expected.
@rsc
Copy link
Contributor

rsc commented Jul 12, 2010

Comment 1:

Labels changed: added compilerbug.

Owner changed to r...@golang.org.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Jul 15, 2010

Comment 2:

This issue was closed by revision 08a263a.

Status changed to Fixed.

@nsf nsf added fixed labels Jul 15, 2010
@nsf nsf assigned rsc Jul 15, 2010
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
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

3 participants