[Issue 2091] D2 final cannot be applied to variable

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Apr 2 05:29:39 PDT 2015


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

Daniel Kozak <kozzi11 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |kozzi11 at gmail.com
         Resolution|INVALID                     |---

--- Comment #2 from Daniel Kozak <kozzi11 at gmail.com> ---
No, i would say it is a bug and a it is a really annoying problem for many
people I works with.

Because methods in D are virtual by default, so using

class A { final:
//final methods
}

is really common pattern in our codebase
(OK to be fair we use a little modified pattern)
class A {
// members
// virtual methods
final:
//final methods
}

But after there will be a way how to marks methods as non final (virtual,
final!false ...)
It makes it easier, one just need to write:

class A { final:

instead of:

class A {

I really does not see any reason why final is applied on members

--


More information about the Digitalmars-d-bugs mailing list