https://issues.dlang.org/show_bug.cgi?id=24454

--- Comment #4 from Bolpat <[email protected]> ---
(In reply to Steven Schveighoffer from comment #1)
> case c2 seems fine to me. What is the problem with it? This seems akin to
> string interning.

Strings barely have identity, but class objects in general have identity. One
might expect every `S` default initialized instance has its own `immutable C`
object referenced by `c2`, but that’s not the case! Surprising programmers
simply isn’t a great idea and a workaround is easy.

--

Reply via email to