[Issue 3396] Call of abstract method not detected by semantic check

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Aug 11 06:48:00 PDT 2014


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

yebblies <yebblies at gmail.com> changed:

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

--- Comment #6 from yebblies <yebblies at gmail.com> ---
This code:

abstract class A
{
   abstract void M();
}

could mean one of two things:
1. M is a pure virtual function
2. M provides 'base class functionality', but this is a di file so the body
isn't present.

The compiler makes the conservative assumption 2, because it has no way to tell
which was intended.

A quick test makes it look like additionally marking the base class function
with @disable makes it impossible to call without breaking inheritance.

--


More information about the Digitalmars-d-bugs mailing list