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

--- Comment #11 from ZombineDev <petar.p.ki...@gmail.com> ---
A const reference to an object may actually refer to a immutable object. If
such object sits in ROM than failure of the compiler to prevent such error
(modification of the monitor) may have bad consequences (depending on the
implementation). Also most of the time, an object is being synchronized to
ensure exclusive write access to it. However there's no point in that if the
object is not mutable.

As for pure, personally I don't think that pure functions should be allowed to
cause a deadlock (I consider it to be a global side effect). Furthermore, 99%
of the time synchronized is used on shared objects, which pure functions have
no business looking at.

--

Reply via email to