October 19, 2012 [Issue 8855] New: cannot define a function name that matches a package name in import statements | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=8855 Summary: cannot define a function name that matches a package name in import statements Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: thelastmammoth@gmail.com --- Comment #0 from thelastmammoth@gmail.com 2012-10-19 11:47:54 PDT --- 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; -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation