Bug 8855 – cannot define a function name that matches a package name in import statements

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-10-19T11:47:54Z
Last change time
2024-12-13T18:01:46Z
Assigned to
No Owner
Creator
thelastmammoth
See also
https://issues.dlang.org/show_bug.cgi?id=11847
Moved to GitHub: dmd#17558 →

Comments

Comment #0 by thelastmammoth — 2012-10-19T11:47:54Z
When I define a function name (eg test() ) that matches a package name in import statements (eg test.fun), I get a CT error: function main.test conflicts with import main.test at main.d(1). Not only is the CT error misleading, causing headaches in larger projects, but also, is that an intended restriction? suppose the following files: ├── main.d └── test └── fun.d cat main.d: import test.fun; void test(){} //CT error: function main.test conflicts with import main.test at main.d(1) void main(){} cat test/fun.d: module test.fun;
Comment #1 by robert.schadek — 2024-12-13T18:01:46Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17558 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB