[Issue 9653] New: Wrong implicit cast allowed with inheritance

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 5 16:53:35 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9653

           Summary: Wrong implicit cast allowed with inheritance
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-03-05 16:53:33 PST ---
C1.foo correctly reports error with wrong implicit conversion from TypeInfo to
inout(TypeInfo), but C2.foo doesn't.

class B {
    inout(TypeInfo) foo() nothrow pure inout {
        return null;
    }
}
class C1 {
    /*override*/ inout(TypeInfo) foo() inout {
        return typeid(Object);  // error, correct
    }
}
class C2 : B {
    override inout(TypeInfo) foo() inout {
        return typeid(Object);  // no error, BUG
    }
}

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


More information about the Digitalmars-d-bugs mailing list