[Issue 2986] New: wrong lookup: interface declaration inside function scope

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 15 16:48:42 PDT 2009


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

           Summary: wrong lookup: interface declaration inside function
                    scope
           Product: D
           Version: 2.030
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: rsinfu at gmail.com


--------------------
void foo()
{
    interface I { }
}
void bar()
{
    interface I { void foo(); }
    I i;
    i.foo();
}
--------------------
test.d(9): Error: no property 'foo' for type 'test.foo.I'
test.d(9): Error: function expected before (), not __error of type int
--------------------

The compiler uses foo.I instead of bar.I. This prevents me from using local
interfaces inside unittests.

This does not happen with classes nor structs.

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