[Issue 7491] import symbol name unavailable in class scope

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 13 01:48:05 PST 2012


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


Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla at digitalmars.com
         Resolution|                            |INVALID


--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> 2012-02-13 01:48:01 PST ---
Right, the lookup rules are being followed by the compiler, that is, super
classes are looked at before module scope is. To get around that, prefix with
the . as in:

module b;
import a, std.stdio;

class Derived : Base
{
    void foo()
    {
        .std.stdio.writeln("Derived");
        ^ note . prefix
    }
}

-- 
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