Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object.d hijacked #18897

Open
dlangBugzillaToGithub opened this issue Oct 10, 2014 · 0 comments
Open

object.d hijacked #18897

dlangBugzillaToGithub opened this issue Oct 10, 2014 · 0 comments

Comments

@dlangBugzillaToGithub
Copy link

Jacob Carlborg (@jacob-carlborg) reported this on 2014-10-10T06:26:24Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=13593

Description

I have a file named "Object.d", in a directory called "foo". The module name of this file is "foo.Object". As it happens, I'm using OS X which uses a case insensitive file system. I also have another file, say "Bar.d" in "foo", with the module name "foo.Bar". When I try to compile/run Bar.d with rdmd as follows:

rdmd foo/Bar.d

I get a lot of errors like "undefined identifier string" and "undefined identifier size_t" from some modules in druntime and Phobos. If I rename  "foo/Object.d" to "foo/Object2.d", leaving the module name as "foo.Object" everything works as expected.

I think the issue is that "rdmd" adds a  flag, "-Ifoo", when running dmd to get the dependencies. But the module system should still prevent it. It seems like the compiler uses the filename instead of the declared module name as the module name.

This is similar to issue 90 [1]. I don't know if we should reopen that one instead.

[1] https://issues.dlang.org/show_bug.cgi?id=90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant