D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9194 - Module imports are not properly checked when found in import path
Summary: Module imports are not properly checked when found in import path
Status: RESOLVED DUPLICATE of issue 16071
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2012-12-22 05:20 UTC by Andrej Mitrovic
Modified: 2016-10-14 15:49 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2012-12-22 05:20:20 UTC
.\main.d
.\foo.d

main.d:

module main;
import foo;
void main() { test(); }

foo.d:

module bar;
void test() { }

This is OK:

$ dmd -c main.d foo.d
> main.d(2): Error: module bar from file foo.d must be imported as module 'bar'

This should also fail to compile but it doesn't
$ dmd -c main.d
>
Comment 1 Mathias Lang 2016-10-14 15:49:59 UTC
According to Walter, this is by design. See the duplicate bug.

*** This issue has been marked as a duplicate of issue 16071 ***