-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
make empty mutable structs non-singletons #17149
Comments
:) I think there may even be a few places already where we do so, but inconsistently. Alternatively, you could make mutable singletons unique values instead of being strangely almost equivalent to their immutable cousins. |
Yes, having mutable singletons be unique would be cool. Currently I'm adding an unused |
I thought this is only about codegen calling convention rather than object construction? "mutable" singletons should already be unique. What does adding a |
type N end
N()===N()
true
type N1 i::Int; N1()=new() end
N1()===N1()
false Each call to |
OK, you mean |
@eschnett: You can use a field of eg type But I agree that it would be nice if there could be multiple instances of mutable types without fields. The current behavior was very handy before we had immutables, but now that we do, it just feels inconsistent. |
This came up on discourse recently. I agree that having mutable singletons construct unique (not |
Marking as triage since it seems like this should really get decided before 1.0. |
Triage says yes, let's make empty mutable structs give non-singleton. |
note to self
The text was updated successfully, but these errors were encountered: