www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2986] New: wrong lookup: interface declaration inside function scope

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: rsinfu 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: -------
May 15 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2986


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |WORKSFORME


--- Comment #1 from Don <clugdbug yahoo.com.au> 2011-02-12 14:40:35 PST ---
Failed 2.030, Fixed DMD2.031.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 12 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2986



--- Comment #2 from github-bugzilla puremagic.com 2012-04-15 05:04:43 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/dc6c8c6c93ce4193b472c9cab4fefcdc66f2fb3f
Removed workarounds for resolved bug 2986

https://github.com/D-Programming-Language/phobos/commit/da44d0b006c0785538aa5537baf1626b6139a56d
Merge pull request #525 from denis-sh/remove-workarounds-for-2986

Removed workarounds for resolved bug 2986

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