[Issue 3182] compile time access of imported symbol

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 16 08:12:43 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3182


Jarrett Billingsley <jarrett.billingsley at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jarrett.billingsley at gmail.c
                   |                            |om




--- Comment #1 from Jarrett Billingsley <jarrett.billingsley at gmail.com>  2009-07-16 08:12:41 PDT ---
I don't think your ideas on the ordering are right.  You can place imports
anywhere in a module and their symbols will be accessible before or after.  For
instance:

[mod.d]
module mod;
void foo() {}

[test.d]
void bar() { foo(); } // fine
import mod;

So, if anything, I'd expect the output to be

z!
z!
z=1!

But the compiler doesn't seem to be doing that.  That the static if before the
import causes later references to 'z' to be invalid is even stranger.  Also, if
you replace 'z' with something else (like "void z(){}"), you get other
behavior, making me think that the semantic analysis is being done differently
for different types.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list