Skip to content

Interface implementation errors are not descriptive. #200

Closed
@emidoots

Description

@emidoots

Running this program on play.golang.org produces:

/tmp/sandbox161431897/main.go:14: cannot convert T literal (type T) to type FooBar:
    T does not implement FooBar (missing Bar method)

It tells us that Bar is the missing method (i.e. what the error actually is).

But running the same program via gopherjs.org/play produces a error that is very hard to understand:

prog.go:14:13: cannot convert (T literal) (value of type T) to FooBar 

I actually have code that uses some very large composite interfaces -- and it's hard to track down exactly what I've done wrong (it's code that cannot be run via the standard Go compiler itself, only by gopherjs).

Any ideas on a potential workaround or improvement to this situation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions