www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1403] New: Incorrect scope in unit test

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1403

           Summary: Incorrect scope in unit test
           Product: D
           Version: 2.003
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: reiner.pope gmail.com


As desired, the following code fails to compile:
unittest {
    interface Foo {
        int a();
    }
}

unittest {
    Foo f;
    f.a();
}

However, the following code *does* compile:
unittest {
    interface Foo {
        int a();
    }
}

unittest {
    interface Foo {
        int b();
    }

    Foo f;
    f.a(); // we have the wrong Foo here
}

and if f.a() is changed to f.b(), it doesn't compile.


-- 
Aug 05 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1403


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
           Platform|x86                         |All
            Version|2.003                       |D1 & D2
         Resolution|                            |WORKSFORME
         OS/Version|Windows                     |All



Works with current dmd (2.058 & 1.068)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 29 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1403




Wait a sec, Reiner Pope? Did we go to the same highschool?

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