www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10744] New: Rejects valid interface inheritance + wrong error message

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10744

           Summary: Rejects valid interface inheritance + wrong error
                    message
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: yazan.dabain gmail.com



interface A {
  Foo foo();
  int x(); // must exist for the bug to appear
}

class B : A {
  override Bar foo() { // must return a child of the class returned by the
interface
    return new Bar();
  }
  override int x() { return 0; } // must exist
}

class Foo {
  void foo() {}
}

class Bar : Foo {
  override void foo() {}
}

void main() {}

On DMD GIT HEAD commit 73e375a, the compiler errors with the following message:
main.d(6): Error: class main.B interface function 'int x()' is not implemented

The example compiles successfully on DMD v2.063.2

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 02 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10744


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



08:12:26 PDT ---
Reduced test-case:

-----
interface A
{
    Foo foo();
    int x();
}

class B : A
{
    Bar foo() { return null; }
    int x() { return 0; }
}

class Foo { }
class Bar : Foo { }

void main() { }
-----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 03 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10744


Henning Pohl <henning still-hidden.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |henning still-hidden.de



PDT ---
https://github.com/D-Programming-Language/dmd/pull/2451

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 06 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10744




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/a291385c024e4477dd0d3b5eccb430ef058bb8bc
fix issue 10744 - Rejects valid interface inheritance + wrong error
message

https://github.com/D-Programming-Language/dmd/commit/0e2779a4cce616c3ede135fe8d4b06a7b91333f5


[REG2.064a] fix issue 10744 - Rejects valid interface inheritance + wrong error
message

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 06 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10744


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 06 2013