[Issue 24666] New: Two modules, mutually importing each other, silently ignores bodies of static conditions
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Wed Jul 17 10:49:50 UTC 2024
    
    
  
https://issues.dlang.org/show_bug.cgi?id=24666
          Issue ID: 24666
           Summary: Two modules, mutually importing each other, silently
                    ignores bodies of static conditions
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: feklushkin.denis at gmail.com
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
--
    
    
More information about the Digitalmars-d-bugs
mailing list