Thread overview
[Issue 23595] Error: undefined identifier with static if and module/import order
Jan 03, 2023
Iain Buclaw
Jan 03, 2023
Iain Buclaw
Jan 03, 2023
Iain Buclaw
Jan 04, 2023
Adam D. Ruppe
Jan 04, 2023
Iain Buclaw
Jan 16, 2023
Dlang Bot
January 03, 2023
https://issues.dlang.org/show_bug.cgi?id=23595

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
                 CC|                            |ibuclaw@gdcproject.org

--
January 03, 2023
https://issues.dlang.org/show_bug.cgi?id=23595

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Related test.

---
module simpleaudio;
struct AudioOutputThread
{
    alias Sample = AudioPcmOutThreadImplementation.Sample;
}

import core.types;

class AudioPcmOutThreadImplementation
{
    pthread_t id;
    struct Sample { }
}
---
module png;
struct GC
{
    import core.types;
}
---
module core.types;
static if (true)
    alias ulong c_ulong;
alias c_ulong pthread_t;

--
January 03, 2023
https://issues.dlang.org/show_bug.cgi?id=23595

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Related test, also has the error:

    simpleaudio.d(13): Error: class `Thread` is forward referenced

---
module simpleaudio;
struct AudioOutputThread
{
    alias Sample = AudioPcmOutThreadImplementation.Sample;
}

import core.types;

class Thread
{
    void[pthread_mutex_t.sizeof] _slock;
}
alias MainThreadStore = void[__traits(classInstanceSize, Thread)];

class AudioPcmOutThreadImplementation : Thread
{
    struct Sample { }
}
---
module png;
struct GC
{
    import core.types;
}
---
module core.types;
static if (true)
    enum __SIZEOF_PTHREAD_MUTEX_T = 1;
union pthread_mutex_t
{
    byte[__SIZEOF_PTHREAD_MUTEX_T] __size;
}

--
January 04, 2023
https://issues.dlang.org/show_bug.cgi?id=23595

Adam D. Ruppe <destructionator@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator@gmail.com

--
January 04, 2023
https://issues.dlang.org/show_bug.cgi?id=23595

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=23598

--
January 16, 2023
https://issues.dlang.org/show_bug.cgi?id=23595

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ibuclaw created dlang/dmd pull request #14826 "dmd.aggregate: Define importAll override for AggregateDeclaration" fixing this issue:

- fix Issue 23595 - Error: undefined identifier with static if and module/import order

https://github.com/dlang/dmd/pull/14826

--