[Issue 14854] @disable this inconsistent between structs and classes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 9 05:32:28 UTC 2018


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

--- Comment #2 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
My suggestion is to make it an error when @disable is used on a function with a
body - just like happens right now when you do it with @disable this() {} on a
struct. I can't think of any reason why this would be a problem. Certainly, I
don't see why it would ever make sense to declare an @disabled function with a
body. By definition, it's unreachable.

However, it will need to be done as a deprecation first in case anyone does
have code that has @disable on a function with a body (like in the example here
with a class).

--


More information about the Digitalmars-d-bugs mailing list