You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code fails to compile:
$ cat test3.go
package test
type T interface{}
var a = T("foo")
var b = (interface{})("bar")
kirk@mooquack ~/dev/gotest $ 6g test3.go
test3.go:5: illegal constant expression CONVIFACE string
test3.go:6: illegal constant expression CONVIFACE string
Given that the string type is assignment compatible with both T and
interface{}, I would expect this code to compile. The code compiles
successfully if string variables are used instead of string literals.
$ echo $GOOS $GOARCH
linux amd64
$ hg log -l1
changeset: 4040:703fb2c605af