D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21922 - rdmd linker error with simple import structure
Summary: rdmd linker error with simple import structure
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: tools (show other issues)
Version: D2
Hardware: x86 Windows
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-15 09:22 UTC by bmqawsed4
Modified: 2022-12-17 10:31 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bmqawsed4 2021-05-15 09:22:00 UTC
See code below. rdmd main.d fails with 'Error 42 Undefined Symbol'.
Unexpectedly,removing the comment around import B in main removes issue at cost of widening scope.

// main
void main() {
   import A;
// import B;
   import std.stdio;

   writeln("Entered main");

   fnA1();
   
   writeln("Leaving main");
}

module A;

void fnA1() {

   import B;
   import std.stdio;
   
   writeln("Entered fnA1");
   fnB1();
   writeln("Leaving fnA1");
}

module B;

void fnB1() {
   
   import std.stdio;
   
   writeln("Entered fnB1");
   writeln("Leaving fnB1");   
}