]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/types2: don't report two errors for bad strings
authorRobert Griesemer <gri@golang.org>
Thu, 10 Dec 2020 03:15:15 +0000 (19:15 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 14 Dec 2020 21:27:49 +0000 (21:27 +0000)
commitdf58f3368e62fbc290b419f0b33b97a984b9ca19
tree44b9d903ab143737900f2c51359a1372911ad536
parent91803a2df334ddfc9377ef4d07cc5f0eff51b6a2
[dev.typeparams] cmd/compile/internal/types2: don't report two errors for bad strings

If the parser reported an error for (string) literals, don't report
a second error during type checking.

This should have a couple of tests but they are tricky to arrange
with the current testing framework as the ERROR comment cannot be
on the line where the string. But the change is straightforward
and we have test/fixedbugs/issue32133.go that is passing now.

Change-Id: I0cd7f002b04e4092b8eb66009c7413288c8bfb23
Reviewed-on: https://go-review.googlesource.com/c/go/+/277993
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/resolver.go
src/cmd/compile/internal/types2/typexpr.go
test/run.go