www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7848] New: pure doesn't work on unittest blocks

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

           Summary: pure doesn't work on unittest blocks
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: jmdavisProg gmx.com



PDT ---
This code compiles when it shouldn't:

void main()
{
}

void func()
{
}

pure unittest
{
    func();
}

func is impure and should cause the compilation of the unittest block to fail.
It fails if you mark it as  safe (since func is  system), but it doesn't fail
for pure.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 06 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7848


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
            Version|unspecified                 |D2
            Summary|pure ignored on unittest    |pure and nothrow ignored on
                   |blocks                      |unittest blocks



Same bug exists for nothrow unittest

void func() {}
nothrow unittest { func(); }

Compiler fix:
https://github.com/D-Programming-Language/dmd/pull/2142

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 06 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7848




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/da5c0cfbd5f8e66dd0bbc180c424f3d58686bd4c
fix Issue 7848 - pure and nothrow ignored on unittest blocks

https://github.com/D-Programming-Language/dmd/commit/21c30ac9dea49cfc234e8f2268efe09a21b630c8


Issue 7848 - pure and nothrow ignored on unittest blocks

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 07 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7848


Walter Bright <bugzilla digitalmars.com> changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 07 2013