You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementation detail: what matters is whether the zero-width object is heap allocated or stack allocated. In some sense it is still the compiler's decision, but this decision is made depending on the input program.
Anyway, as the spec says, this is work-as-intended.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I ran two slightly different programs:
What did you expect to see?
Spec says "Pointers to distinct zero-size variables may or may not be equal."
I expected the answer of whether they are to be a compiler implementation decision and not behavior that changes depending on the input program.
What did you see instead?
I see that two zero-width values are equal only when they are otherwise used. They are treated as unequal otherwise.
The text was updated successfully, but these errors were encountered: