Thread overview
[Issue 13690] Interface final method which overrides a method in the parent interface leads to unimplementable interface
[Issue 13690] Curiously Recurring Template Pattern
Jan 19, 2015
Kenji Hara
Feb 22, 2018
RazvanN
Feb 22, 2018
RazvanN
Feb 28, 2020
Simen Kjaeraas
January 19, 2015
https://issues.dlang.org/show_bug.cgi?id=13690

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Curiously Recurring         |Curiously Recurring
                   |Template Pattern causes     |Template Pattern
                   |segfault.                   |

--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> ---
Segfault doesn't occur with git-head (2.067alpha), and the code reports
following errors:

test.d(10): Error: expression hasMember!(Foo1, "rotation") of type void does
not have a boolean value
test.d(10): Error: template instance std.traits.hasMember!(Foo1, "rotation")
error instantiating
test.d(28):        instantiated from here: Bar!(Foo1)
test.d(10): Error: expression hasMember!(Foo2, "rotation") of type void does
not have a boolean value
test.d(10): Error: template instance std.traits.hasMember!(Foo2, "rotation")
error instantiating
test.d(32):        instantiated from here: Bar!(Foo2)

Remove "segfault" word from the subject.

--
February 22, 2018
https://issues.dlang.org/show_bug.cgi?id=13690

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #2 from RazvanN <razvan.nitu1305@gmail.com> ---
Running the example on dmd 2.078.0 Ubuntu 16.04 results in :

test.d(27): Error: class `test.Foo1` interface function void do_a_thing() is
not implemented
test.d(31): Error: class `test.Foo2` interface function void do_a_thing() is
not implemented
test.d(31): Error: class `test.Foo2` interface function double rotation()
@property is not implemented

So the real problem here is this: (reduced test case)

interface A
{
    void x();
}

interface B : A
{
    final void x() { }
}

class C : B
{
    //override void x() {}
}

If the method in C is commented you will get error stating that you are not implementing x. If you uncomment you will get an error stating that you cannot override final method. That's the real bug. Changing the title to reflect that

--
February 22, 2018
https://issues.dlang.org/show_bug.cgi?id=13690

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Curiously Recurring         |Interface final method
                   |Template Pattern            |which overrides a method in
                   |                            |the parent interface leads
                   |                            |to unimplementable
                   |                            |interface

--
February 28, 2020
https://issues.dlang.org/show_bug.cgi?id=13690

Simen Kjaeraas <simen.kjaras@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |simen.kjaras@gmail.com
         Resolution|---                         |DUPLICATE

--- Comment #3 from Simen Kjaeraas <simen.kjaras@gmail.com> ---
Moving this to issue 16306, since that issue contains less noise and has a perfect example in the first comment.

*** This issue has been marked as a duplicate of issue 16306 ***

--