]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: suppress callsite signatures if any type is unknown
authorEmmanuel Odeke <emm.odeke@gmail.com>
Sat, 11 Feb 2017 06:41:53 +0000 (23:41 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 22 Feb 2017 17:55:45 +0000 (17:55 +0000)
commit19d2061d502d26086d6db75fa818dde668a888bf
tree1b48d5148013cb19e5d6aa4a098a4ea42115c8cf
parentffb3b3698c695b2ada052b803f11a2ffa12e5537
cmd/compile: suppress callsite signatures if any type is unknown

Fixes #19012.

Fallback to return signatures without detailed types.
These error message will be of the form of issue:
* https://golang.org/issues/4215
* https://golang.org/issues/6750

So:
func f(x int, y uint) {
    return x > y
}

f(10, "a" < 3)

will give errors:
too many errors to return
too many arguments in call to f

instead of:

too many errors to return
  have (<T>)
  want ()
too many arguments in call to f
  have (number, <T>)
  want (number, number)

Change-Id: I680abc7cdd8444400e234caddf3ff49c2d69f53d
Reviewed-on: https://go-review.googlesource.com/36806
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/typecheck.go
test/fixedbugs/issue19012.go [new file with mode: 0644]