Thread overview
[Issue 19235] Repeatedly calling non-pure function in non-pure literal nested in pure function is broken
Sep 08, 2018
Johannes Pfau
Dec 17, 2022
Iain Buclaw
Apr 28, 2023
RazvanN
September 08, 2018
https://issues.dlang.org/show_bug.cgi?id=19235

--- Comment #1 from Johannes Pfau <johannespfau@gmail.com> ---
Same problem  with static nested functions:

-------------------------------------------------
struct FloatingPointControl
{
    void foo() pure
    {
            static bool nested() {
                setControlState(0);
                setControlState(0);
                return 0;
            }
    }

private:
    static void setControlState(uint newState)
    {
    }
}
-------------------------------------------------

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=19235

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
April 28, 2023
https://issues.dlang.org/show_bug.cgi?id=19235

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |WORKSFORME

--- Comment #2 from RazvanN <razvan.nitu1305@gmail.com> ---
The code compiles with the latest git master, which is correct: you can define a non pure function in a pure function as long as you don't call it.

--