Thread overview
[Issue 3247] New: Crash on overriding class methods with 'auto' return type
Aug 12, 2009
Don
Aug 12, 2009
Don
August 12, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3247

           Summary: Crash on overriding class methods with 'auto' return
                    type
           Product: D
           Version: 2.031
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: jarrett.billingsley@gmail.com


class A
{
    auto foo() { return 0; }
}

class B : A
{
    override auto foo() { return 5; }
}


The compiler crashes.  It also crashes if A.foo's return type is int or B.foo's return type is int (but not if both are int, obviously).  It doesn't crash if foo is not overridden.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 12, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3247


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug@yahoo.com.au




--- Comment #1 from Don <clugdbug@yahoo.com.au>  2009-08-12 08:48:53 PDT ---
Is it the same as bug#3042?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 12, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3247


Don <clugdbug@yahoo.com.au> changed:

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




--- Comment #2 from Don <clugdbug@yahoo.com.au>  2009-08-12 08:51:45 PDT ---
With my patch for bug #3042 applied, this generates:

bug.d(4): Error: function ice.B.foo of type () overrides but is not covariant w
ith ice.A.foo of type ()

So marking as duplicate.

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

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