Skip to content

cmd/compile: internal compiler error: getinarg: not a func when returning invalid interface #10975

Closed
@dominikh

Description

@dominikh

Input:

package bug

type I interface {
    int
}

func New() I {
    return struct{}{}
}

Output:

dominikh-pc /tmp $ go build foo.go
# command-line-arguments
./foo.go:4: interface contains embedded non-interface int
./foo.go:8: internal compiler error: getinarg: not a func int

Expected output:
No internal compiler error.

Version:
go version devel +5ee5528 Thu May 28 12:04:35 2015 +0000 linux/amd64

Also happens with Go 1.4.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions