-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile: confusing type assertion failure error message #49005
Comments
/cc @griesemer @findleyr |
A variant:
In this case X is defined, and the problem is that *X does not implement the M method. But the actual message does not show a type assertion. I assume that printing the actual assertion expression will result in
That will be confusing too, because it will no longer mention T.
|
The problem seems that with types2, when But I think the root cause is that the check |
good idea, @cuonglm ! |
Change https://golang.org/cl/356449 mentions this issue: |
…assertion This CL avoids a useless follow-on error (that gets reported before the actual error due to source position). This addresses the first part of the issue below. Thanks to @cuonglm for the suggestion for the fix. For #49005. Change-Id: Ifdd83072a05c32e115dc58a0233868a64f336f3f Reviewed-on: https://go-review.googlesource.com/c/go/+/356449 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Change https://golang.org/cl/356512 mentions this issue: |
The problem in this program is that X is not defined.
The first error is very confusing and is noise.
The text was updated successfully, but these errors were encountered: