-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Open
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
With
gccgo (google-gccgo-261288) 9.0.0 20180607 (experimental)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
the following program
$ cat x.go
package main
func main() {
}
type I interface {
M1() interface {
I
}
M2() interface {
I
}
}
type S struct{}
func (S) M1() interface{ I } {
return nil
}
func (S) M2() interface{ I } {
return nil
}
crashes the compiler:
$ gccgo x.go
gccgo: internal compiler error: Segmentation fault signal terminated program go1
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://go.ext.google.com/go/> for instructions.
The program compiles (somewhat surprisingly) without error if the struct definition is absent:
$ cat x.go
package main
func main() {
}
type I interface {
M1() interface {
I
}
M2() interface {
I
}
}
For the reference:
- go/types accepts this code (not clear that it should)
- cmd/compile doesn't terminate (issue cmd/compile: recursive embedded interface types cause stack overflow #25262)
cc: @thanm
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.