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

          Issue ID: 22869
           Summary: Child class that doesn't implement an interface
                    function allowed to be used
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

This code produces a crashing binary. The `Oops` class doesn't implement the
`accept` function, which is also not implemented in the base class either. This
shouldn't be allowed to compile, but currently does and crashes at runtime.


----------
class Visitor { }

interface Visitable {
    void accept(Visitor) @safe;
}

abstract class Abstract : Visitable { }
class Oops : Abstract { }

void main() {
    Abstract oops = new Oops;
    scope visitor = new Visitor;
    oops.accept(visitor);
}
----------

--

Reply via email to