Commit graph

6 commits

Author SHA1 Message Date
cuiweixie 336ce966e4 cmd/compile: use "missing method m" instead of "missing m method"
For #55326

Change-Id: I3d0ff7f820f7b2009d1b226abf701b2337fe8cbc
Reviewed-on: https://go-review.googlesource.com/c/go/+/432635
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: xie cui <523516579@qq.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2022-09-24 17:04:15 +00:00
Robert Griesemer 254c497e5c cmd/compile, types2: better error message for invalid type assertion
This CL addresses the 2nd part of the issue below.

- For types2, now use the same error messages as the compiler in this case.
- Make the mechanism for reporting clarifying error messages handle the case
  where we don't have additional position information.
- Provide context information (type assertion vs type switch).

Fixes #49005.

Change-Id: I4eeaf4f0c3f2f8735b63993778f58d713fef21ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/356512
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-10-19 17:01:35 +00:00
Robert Griesemer 5aca6e7857 [dev.typeparams] test: finish triaging all outstanding failing tests
Also: Adjusted error patterns for passing test that have different
error messages.

Change-Id: I216294b4c4855aa93da22cdc3c0b3303e54a8420
Reviewed-on: https://go-review.googlesource.com/c/go/+/277994
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>
2020-12-14 21:28:48 +00:00
Emmanuel Odeke 34b563f447 cmd/compile: improve error for wrong type in switch
Fixes #10561.

Provides a better diagnostic message for failed type switch
satisfaction in the case that a value receiver is being used
in place of the pointer receiver that implements and satisfies
the interface.

Change-Id: If8c13ba13f2a8d81bf44bac7c3a66c12921ba921
Reviewed-on: https://go-review.googlesource.com/35235
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-02 17:36:43 +00:00
Josh Bleecher Snyder cf20525bf4 cmd/compile: set correct line number for multiple defaults in switch error
Fixes #15911.

Change-Id: I500533484de61aa09abe4cecb010445e3176324e
Reviewed-on: https://go-review.googlesource.com/26760
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-08-22 19:56:06 +00:00
Josh Bleecher Snyder 8003e79154 test: add more switch error handling tests
Some of these errors are reported in the wrong places.
That’s issue #15911 and #15912.

Change-Id: Ia09d7f89be4d15f05217a542a61b6ac08090dd87
Reviewed-on: https://go-review.googlesource.com/23588
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-31 22:29:36 +00:00