[Issue 7330] Local imports are order sensitive

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 20 17:21:45 PST 2012


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


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com


--- Comment #3 from Jonathan M Davis <jmdavisProg at gmx.com> 2012-01-20 17:21:42 PST ---
Yeah. I don't think that this is a bug, but then again, I wouldn't have been
surprised if it didn't work to put imports at module scope after the line where
you use what you're importing. It would just be so bizarre to put the imports
anywhere but at the top that I've never thought about it.

But consider that the order of declarations of module variables doesn't
normally matter (it can with static if), but it matters a great deal at local
scope. So, for imports to work the same makes sense.

I'm not quite sure how the language spec would be updated though. I don't know
how you could have interpreted it to mean that you could put them after the
line where you used what you're importing within a function. I would have
thought that it was crystal clear as it is.

-- 
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