-
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: better error msg for impossible type assertions #43831
base: master
Are you sure you want to change the base?
Conversation
This PR (HEAD: 38fd519) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/285372 to see it. Tip: You can toggle comments from me using the |
Message from Matthew Dempsky: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
38fd519
to
8262bed
Compare
This PR (HEAD: 8262bed) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/285372 to see it. Tip: You can toggle comments from me using the |
Message from Hau Yang: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Matthew Dempsky: Patch Set 2: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
8262bed
to
fde01d3
Compare
This PR (HEAD: fde01d3) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/285372 to see it. Tip: You can toggle comments from me using the |
Message from Hau Yang: Patch Set 3: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Matthew Dempsky: Patch Set 3: (10 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
fde01d3
to
6a41d32
Compare
This PR (HEAD: 6a41d32) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/285372 to see it. Tip: You can toggle comments from me using the |
Message from Hau Yang: Patch Set 3: (8 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Matthew Dempsky: Patch Set 4: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Matthew Dempsky: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Baokun Lee: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
6a41d32
to
8a25cc4
Compare
Message from Hau Yang: Patch Set 5: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
This PR (HEAD: 8a25cc4) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/285372 to see it. Tip: You can toggle comments from me using the |
Message from Hau Yang: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Baokun Lee: Patch Set 6: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Go Bot: Patch Set 6: TryBots beginning. Status page: https://farmer.golang.org/try?commit=aa084373 Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Go Bot: Patch Set 6: Build is still in progress... Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Go Bot: Patch Set 6: TryBot-Result-1 2 of 21 TryBots failed: Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
8a25cc4
to
c5a246b
Compare
This PR (HEAD: c5a246b) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/285372 to see it. Tip: You can toggle comments from me using the |
Message from Hau Yang: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 12: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Robert Griesemer: Patch Set 12: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Matthew Dempsky: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Matthew Dempsky: Patch Set 2: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 3: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Matthew Dempsky: Patch Set 3: (10 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 3: (8 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Matthew Dempsky: Patch Set 4: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Matthew Dempsky: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Baokun Lee: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 5: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Baokun Lee: Patch Set 6: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Go Bot: Patch Set 6: TryBots beginning. Status page: https://farmer.golang.org/try?commit=aa084373 Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Go Bot: Patch Set 6: Build is still in progress... Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Go Bot: Patch Set 6: TryBot-Result-1 2 of 21 TryBots failed: Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Robert Griesemer: Patch Set 7: (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 8: (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Matthew Dempsky: Patch Set 8: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Robert Griesemer: Patch Set 8: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 9: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 9: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Matthew Dempsky: Patch Set 10: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 10: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Hau Yang: Patch Set 12: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Message from Robert Griesemer: Patch Set 12: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/285372. |
Revise the error message under the condition that type assertion has
mismatching pointer/non-pointer type, which means this PR adds a
better error hint for the situation that a user writes x.(*I), but they
meant to write x.(I).
In this situation, compiler would check out whether the the missing
methods are implemented by the dereferenced object. If the dereferenced
object implements these missing methods, then return error message
<original_object> does not have <missing_method> (but <dereferenced_object> does)
Fixes #43673