[Issue 23595] Error: undefined identifier with static if and module/import order

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 3 17:31:54 UTC 2023


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

--- Comment #2 from Iain Buclaw <ibuclaw at 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;
}

--


More information about the Digitalmars-d-bugs mailing list