]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/types2: adjustments toward matching compiler...
authorRobert Griesemer <gri@golang.org>
Tue, 1 Dec 2020 05:28:32 +0000 (21:28 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 1 Dec 2020 21:49:25 +0000 (21:49 +0000)
commit87bc85a846d5dc2d8fe7dbda900d6066ab98f1a5
treefbb025e4dfda047fca81c2255ba9c58120691739
parentfbc4c6a3ae5eb21c93d167e5eebdb07327aa5462
[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>
12 files changed:
src/cmd/compile/internal/types2/api.go
src/cmd/compile/internal/types2/api_test.go
src/cmd/compile/internal/types2/assignments.go
src/cmd/compile/internal/types2/builtins.go
src/cmd/compile/internal/types2/decl.go
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/exprstring.go
src/cmd/compile/internal/types2/exprstring_test.go
src/cmd/compile/internal/types2/testdata/decls3.src
src/cmd/compile/internal/types2/testdata/decls4.src
src/cmd/compile/internal/types2/testdata/issue28251.src
src/cmd/compile/internal/types2/typexpr.go