-
Notifications
You must be signed in to change notification settings - Fork 379
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
fix: addressability problem #2689
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2689 +/- ##
=======================================
Coverage 60.23% 60.23%
=======================================
Files 562 562
Lines 75091 75170 +79
=======================================
+ Hits 45228 45281 +53
- Misses 26482 26503 +21
- Partials 3381 3386 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it is close to completion but there a few more cases that need to be covered.
Also, is this something that we could do in the preprocessor? Like adding an attribute to expressions that are not currently addressable?
Here is another case where execution should not succeed: package main
func main() {
var s S
assert4(s)
}
type S struct {
s string
}
// Should fail but does not
func assert4(i interface{}) {
_ = &((i.(S)).s)
} In this case the type assertion of the struct makes a copy of the value, so it is not addressable and should not be able to get the address of |
Closing in favor of #2731 |
Fixes issue
Alligns the behavior with the Go spec.