www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23658] New: .di generation of variables should turn them into

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

          Issue ID: 23658
           Summary: .di generation of variables should turn them into
                    declarations
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

Currently, generating the .di file for:

 int a = 5;
 int b;
 extern int c;
 void foo() { }
 void bar();
 extern void abc();

results in:

 // D import file generated from 'test4.d'
 int a = 5;
 int b;
 extern int c;
 void foo();
 void bar();
 extern void abc();

Note that foo() was turned from a declaration into a definition, but a and b
were not. They should be. This should make .di header generation much better
for DLLs.

--
Jan 26 2023