https://issues.dlang.org/show_bug.cgi?id=9149
--- Comment #16 from timon.g...@gmx.ch --- (In reply to timon.gehr from comment #11) > > The fix I originally proposed in the first post removes the unsoundness in > the const system, but it is ugly. It means the line "const x = y;" fails if > y is a delegate, but not if y is an instance of a struct wrapping a > delegate. A more elegant solution would be to disallow calling const > delegates whose context is not typed const or immutable. I.e. const(int > delegate()const) can be called, but const(int delegate()) cannot be called. > > Basically the same problem exists for immutable. I updated the title to reflect this more elegant solution. --