diff options
author | Robert Griesemer <gri@golang.org> | 2020-11-30 21:28:32 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2020-12-01 21:49:25 +0000 |
commit | 87bc85a846d5dc2d8fe7dbda900d6066ab98f1a5 (patch) | |
tree | fbb025e4dfda047fca81c2255ba9c58120691739 /src/cmd/compile/internal/types2/builtins.go | |
parent | fbc4c6a3ae5eb21c93d167e5eebdb07327aa5462 (diff) | |
download | go-87bc85a846d5dc2d8fe7dbda900d6066ab98f1a5.tar.gz go-87bc85a846d5dc2d8fe7dbda900d6066ab98f1a5.zip |
[dev.typeparams] cmd/compile/internal/types2: adjustments toward matching compiler error messages
In order to get types2 usable by the compiler, we need to
pass all the compiler tests with respect to error messages.
Sometimes the compiler error messages are better, sometimes
the types2 error messages are better. Where we can, we decide
on a case-by-case basis; but sometimes, for expediency's sake,
we just choose the compiler error message as it may reduce the
amount of tests that we need to update.
This CL introduces a new Config flag: CompilerErrorMessages.
If set, the typechecker emits an error message that matches
the expected errors in the tests most easily. Eventually, we
need to get rid of this flag by either adjusting the typechecker
errors or the test cases; t.b.d. on a case-by-case basis.
This CL also adjust a few error typechecker error messages already.
Change-Id: I9d4e491efadf87e999fc0d5b5151ec02a059f891
Reviewed-on: https://go-review.googlesource.com/c/go/+/274312
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/builtins.go')
-rw-r--r-- | src/cmd/compile/internal/types2/builtins.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/builtins.go b/src/cmd/compile/internal/types2/builtins.go index 6ad84f4354..43da6a1529 100644 --- a/src/cmd/compile/internal/types2/builtins.go +++ b/src/cmd/compile/internal/types2/builtins.go @@ -281,7 +281,7 @@ func (check *Checker) builtin(x *operand, call *syntax.CallExpr, id builtinId) ( // both argument types must be identical if !check.identical(x.typ, y.typ) { - check.invalidArgf(x, "mismatched types %s and %s", x.typ, y.typ) + check.invalidOpf(x, "%s (mismatched types %s and %s)", call, x.typ, y.typ) return } |