Skip to content

cmd/compile: internal compiler error: name too long #27256

Closed
@elagergren-spideroak

Description

@elagergren-spideroak

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.11, darwin/amd64

What did you do?

https://play.golang.org/p/WNDetHOIGt3

$ cat x.go
package tmp

type Q interface {
	Foo()
	Bar()
	Baz()
}

type B interface {
	B() Q
}

type O interface {
	O() interface {
		O
		B
		Q
	}
}

type W interface {
	W() interface {
		O
		B
		Q
	}
}

type S interface {
	S() interface {
		S
		W
		Q
	}
}
# _/tmp
<autogenerated>:1: internal compiler error: name too long: *interface { Bar(); Baz(); Foo(); S() interface { Bar(); Baz(); Foo(); S() interface { Bar(); Baz(); 
[ ... ]
Baz(); Foo(); O() interface { B() tmp.Q; Bar(); Baz(); Foo(); O() interface { B() tmp.Q; Bar(); Baz(); Foo(); O() interface { B<...>; Bar<...>; Baz<...>; Foo<...>; O<...> } } } } } } } } 
[ ... ]

Please file a bug report including a short program that triggers the error.
https://golang.org/issue/new

If you remove S, it compiles just fine.

Related, if only tangentially, to #26863.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions