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
gccgo: crash when compiling code containing some type alias #24722
Comments
Reproducing program extracted from #24721: package m3
import "time"
type t = time.Time
type T = time.Time
type A = struct{t}
type B = struct{T} import "m3"
import "time"
type t = time.Time
type T = time.Time
type A = struct{t}
type B = struct{T}
func main() {
var a, b interface{} = m3.A{}, m3.B{}
var x, y interface{} = A{}, B{}
println(a == x) // true
println(b == y) // true
_ = A(m3.A{}) // cannot convert struct { time.Time } literal (type struct { time.Time }) to type struct { time.Time }
_ = B(m3.B{}) // ok
println(a == b) // true
println(x == y) // true
_ = B(A{}) // cannot convert struct { time.Time } literal (type struct { time.Time }) to type struct { time.Time }
_ = m3.A(m3.B{}) // cannot convert struct { time.Time } literal (type struct { time.Time }) to type struct { time.Time }
} /cc @ianlancetaylor |
@dotaheor Are you saying that for you gccgo crashes? It doesn't crash for me. Which version of gccgo are you running? |
This command Here is another simpler program for verifying.
|
I just upgraded gccgo to |
Thanks for checking. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10.1 linux/amd64
Does this issue reproduce with the latest release?
yes
What did you do?
please view #24721 for details.
What did you expect to see?
not crash
What did you see instead?
crash
The text was updated successfully, but these errors were encountered: