www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15916] New: void makes a function impure + system

https://issues.dlang.org/show_bug.cgi?id=15916

          Issue ID: 15916
           Summary: void makes a function impure + system
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: greeenify gmail.com

auto myfun(int foo)
{
    auto b = foo;
}

pure  safe nothrow unittest
{
    myfun(2);
}

However once the return type is void - the compiler tells me that I have an
impure system function!
Is this by design or a bug?

void myfunv()
{
    int b = 2;
}

pure  safe nothrow unittest
{
    myfunv();
}

(removing/adding the parameter doesn't make a difference)

--
Apr 12 2016