]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/types2: report correct line number for missing key
authorRobert Griesemer <gri@golang.org>
Wed, 9 Dec 2020 23:49:04 +0000 (15:49 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 10 Dec 2020 00:09:51 +0000 (00:09 +0000)
commitdbce27d29c8479d969aad5be4658fde32ff3f1e4
tree56b8d23f4e6b1c74ba4ca3e39316fbc1dd8907e8
parentedf80c4209a03bc656edfa5222b8fbd7fd072401
[dev.typeparams] cmd/compile/internal/types2: report correct line number for missing key

Use the Key position of a syntax.KeyValueExpr (not the position of the
":") when reporting an error for a missing key.

(In go/types, the KeyValueExpr position is the start of the expression
not the ":", so there this works as expected.)

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