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

--- Comment #14 from Steven Schveighoffer <schvei...@yahoo.com> ---
(In reply to timon.gehr from comment #13)
> Do you have an example where conversion to immutable for a strongly pure
> constructor leads to problems?

Basically, the example in comment 3, but with the delegate not being const.

> We can't (for class references, you never know whether some subclass might
> have a mutable delegate field). We need to do something else, but all
> options I have proposed so far are quite ugly (or become ugly when
> considering all the details required to make them work), so I'm open to
> different proposals.

Oh crap. Yeah that's a huge problem. The only thing I can think of is to
disallow const(A) if A has a non-const delegate. And disallow overriding any
const base functions.

--

Reply via email to