[Issue 7730] Make imports work case-sensitive on all platforms

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 19 05:13:12 PDT 2012


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


Stewart Gordon <smjg at iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg at iname.com


--- Comment #5 from Stewart Gordon <smjg at iname.com> 2012-03-19 05:13:27 PDT ---
The problem at the moment is that the capitalisation of a module's name, in the
absence of a module declaration, depends on the name by which it is referenced.
 Try this at home:

----- modulecap_a.d -----
import modulecap_b;
----- ModuleCap_b.d -----
int x = .y;
----------
C:\Users\Stewart\Documents\Programming\D\Tests>dmd modulecap_b.d
modulecap_b.d(1): Error: undefined identifier module modulecap_b.y

C:\Users\Stewart\Documents\Programming\D\Tests>dmd ModuleCap_b.d
ModuleCap_b.d(1): Error: undefined identifier module ModuleCap_b.y

C:\Users\Stewart\Documents\Programming\D\Tests>dmd modulecap_a.d
modulecap_b.d(1): Error: undefined identifier module modulecap_b.y
----------

I can imagine this leading to havoc if the same module is referenced from
different modules by different capitalisations of the name.

If there's a module declaration, go with that.  Otherwise, go with the actual
capitalisation of the filename, thereby ensuring platform-consistent behaviour.

That said, are there any 32+-bit platforms on which filenames aren't
case-retentive?

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