Skip to content

cmd/gc: inconsistent "wrong arg type" error for multivalued g in f(g()) #7129

@gopherbot

Description

@gopherbot

by carlchatfielduntrusted:

Just a minor nuisance that should be trivial to fix. Id expect
the error messages below to follow the same template, they differ
slightly. Personally I prefer the message generated by f(g()).

http://play.golang.org/p/xjw2k1JDMT

        g := func() (bool, bool) { return true, true } 
        f := func(int, int) {} 
        f(g())
    f(true, true)

What is the expected output?
prog.go:6: cannot use bool as type int in argument to f
prog.go:7: cannot use true (type bool) as type int in function argument

What do you see instead?
prog.go:6: cannot use bool as type int in argument to f
prog.go:7: cannot use true (type bool) as type int in argument to f


Which compiler are you using (5g, 6g, 8g, gccgo)?
6g, 8g

Which operating system are you using?
linux

Which version are you using?  (run 'go version')
1.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions