Comment #0 by feklushkin.denis — 2024-07-17T10:49:50Z
Two modules, mutually importing each other, silently ignores bodies of static conditions:
p1/m1.d:
module p1.m1;
import p2.m2; // if commented out then code works as expected
//alias A = int; // will work if uncomment and comment out next code:
static if(true)
alias A = int; // declaration will be ignored
p2/m2.d:
module p2.m2;
import p1.m1: A;
main.d:
import p1.m1;
void main()
{
A a;
}
Compilation:
ldc2 -c -I. main.d
p2/m2.d(3): Error: module `p1.m1` import `A` not found