[Issue 11157] New: base class member hides template parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 2 10:46:48 PDT 2013


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

           Summary: base class member hides template parameter
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at dawg.eu


--- Comment #0 from Martin Nowak <code at dawg.eu> 2013-10-02 10:46:47 PDT ---
cat > bug.d << CODE
class Base
{
    int param;
}

class Foo(int param) : Base
{
    int val()
    {
        return param; // <-- param refers to super.param
    }
}

unittest
{
    auto foo = new Foo!12;
    assert(foo.val() == 12);
}
CODE

dmd -unittest -main -run 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