aboutsummaryrefslogtreecommitdiff
path: root/src/path/filepath/path_test.go
diff options
context:
space:
mode:
authorRob Findley <rfindley@google.com>2020-11-03 17:54:24 -0500
committerRobert Findley <rfindley@google.com>2020-11-05 12:57:20 +0000
commit05568315f2ae8fb86112e63966b46c2dcc8ab6e2 (patch)
tree395a9818c140a37b3acc40cbbf746cdbc0089d90 /src/path/filepath/path_test.go
parent3510a1e32cbc86b73db143aefcc00aadc44c27bd (diff)
downloadgo-05568315f2ae8fb86112e63966b46c2dcc8ab6e2.tar.xz
go/types: simplify error messages for untyped value assignability
CL 242083 corrected an inaccurate error message related to the assignability of untyped constant values. Previously the error message was of the form "cannot convert ... to ...", which is misleading when there is no explicit conversion in the syntax. The new error message corrected this to "cannot use ... as ... in ...", but also appended an inner error message that can be quite verbose. For example: cannot use "123" (untyped string constant) as int value in assignment: cannot convert "123" (untyped string constant) to int" This might be more accurate, but is a regression in readability. Correct this by only including the inner error message in the rare cases where it is helpful: if the constant value overflows or is truncated. For golang/go#22070 Change-Id: I8b8ee6ef713f64facc319894be09398b0b5ea500 Reviewed-on: https://go-review.googlesource.com/c/go/+/267717 Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> Trust: Robert Griesemer <gri@golang.org> Trust: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/path/filepath/path_test.go')
0 files changed, 0 insertions, 0 deletions