D - BUG : import conflict
- Ant (19/19) Sep 30 2003 module A;
- Charles Sanders (9/27) Oct 01 2003 Hmm, including
- Ant (5/11) Sep 30 2003 confirmed!
- jhenzie mac.com (12/48) Oct 01 2003 Prima facie, because of the lack of an explicit import, the comnpiler se...
- Charles Sanders (12/69) Oct 01 2003 language.
module A; private import file; private import outbuffer; void main() { string.toString("asdf"); OutBuffer buf = new OutBuffer(); buf.write("aaaa"); file.write("ffff",(byte[])buf.toBytes()); } I get the compile error: /dmd/src/phobos/file.d(7): import string conflicts with outbuffer.string at /dmd/src/phobos/outbuffer.d(16) if line "string.toString("asdf");" is commented out every thing works as expected. I tried to make the imports at file.d and outbuffer.d private but got the same error. Ant
Sep 30 2003
Hmm, including import string; seems to make it work. Ive seen similar things ( odd error messages about functions im using but not importing ) but im not sure its an import problem. C "Ant" <Ant_member pathlink.com> wrote in message news:bldr36$2u32$1 digitaldaemon.com...module A; private import file; private import outbuffer; void main() { string.toString("asdf"); OutBuffer buf = new OutBuffer(); buf.write("aaaa"); file.write("ffff",(byte[])buf.toBytes()); } I get the compile error: /dmd/src/phobos/file.d(7): import string conflicts with outbuffer.stringat/dmd/src/phobos/outbuffer.d(16) if line "string.toString("asdf");" is commented out every thing works as expected. I tried to make the imports at file.d and outbuffer.d private but got the same error. Ant
Oct 01 2003
In article <bldrk7$2v80$1 digitaldaemon.com>, Charles Sanders says...Hmm, including import string; seems to make it work. Ive seen similar things ( odd error messages about functions im using but not importing ) but im not sure its an import problem. Cconfirmed! probably Walter will want to make a note of it... thanks. Ant
Sep 30 2003
Prima facie, because of the lack of an explicit import, the comnpiler seems unable to disambiguate the implicitly imported string symbols from file and outbuffer. However, making the import string; private should lead to a different message and that is a little concerning. Perhaps what should be done is to only recognize first level namespaces such that imports in imported modules are not recognized in the current module. To be honest, I find the concept of them being automatically available somewhat confusing, making a library function / class appear as part of the language. Just my 2 cents. Justin In article <bldrk7$2v80$1 digitaldaemon.com>, Charles Sanders says...Hmm, including import string; seems to make it work. Ive seen similar things ( odd error messages about functions im using but not importing ) but im not sure its an import problem. C "Ant" <Ant_member pathlink.com> wrote in message news:bldr36$2u32$1 digitaldaemon.com...module A; private import file; private import outbuffer; void main() { string.toString("asdf"); OutBuffer buf = new OutBuffer(); buf.write("aaaa"); file.write("ffff",(byte[])buf.toBytes()); } I get the compile error: /dmd/src/phobos/file.d(7): import string conflicts with outbuffer.stringat/dmd/src/phobos/outbuffer.d(16) if line "string.toString("asdf");" is commented out every thing works as expected. I tried to make the imports at file.d and outbuffer.d private but got the same error. Ant
Oct 01 2003
To be honest, I find the concept of them being automatically availablesomewhatconfusing, making a library function / class appear as part of thelanguage. Yea I agree, hopefully walter will see this. C <jhenzie mac.com> wrote in message news:blf3gr$2185$1 digitaldaemon.com...Prima facie, because of the lack of an explicit import, the comnpilerseemsunable to disambiguate the implicitly imported string symbols from fileandoutbuffer. However, making the import string; private should lead to a differentmessageand that is a little concerning. Perhaps what should be done is to only recognize first level namespacessuchthat imports in imported modules are not recognized in the current module. To be honest, I find the concept of them being automatically availablesomewhatconfusing, making a library function / class appear as part of thelanguage.Just my 2 cents. Justin In article <bldrk7$2v80$1 digitaldaemon.com>, Charles Sanders says...outbuffer.stringHmm, including import string; seems to make it work. Ive seen similar things ( odd error messages about functions im using but not importing ) but im not sure its an import problem. C "Ant" <Ant_member pathlink.com> wrote in message news:bldr36$2u32$1 digitaldaemon.com...module A; private import file; private import outbuffer; void main() { string.toString("asdf"); OutBuffer buf = new OutBuffer(); buf.write("aaaa"); file.write("ffff",(byte[])buf.toBytes()); } I get the compile error: /dmd/src/phobos/file.d(7): import string conflicts withat/dmd/src/phobos/outbuffer.d(16) if line "string.toString("asdf");" is commented out every thing works as expected. I tried to make the imports at file.d and outbuffer.d private but got the same error. Ant
Oct 01 2003