www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - import error and error types

reply spir <denis.spir gmail.com> writes:
Hello,

"import algorithm;" generates the error message:
test.d(35): Error: module algorithm is in file 'algorithm.d' which cannot be
read

Three notes:
* The message is wrong: the error is precisely due to the fact no file 
'algorithm.d' was found.
* A nice tip for phobos modules would be to hint "Did you forget the prefix 
'std.'?".
* There is no mention of import, which would be helpful ;-)

More generally, dmd (and build/link) errors have no "type". Giving errors a 
written type is very helpful (not only to the user, also to organise, name, and 
formulates error messages properly).

test.d(35): Import Error: cannot find module file 'algorithm.d' (in current 
directory or standard import directories).
Did you forget the prefix 'std.' needed to import Phobos modules?

(The additional tip only when module name matches a phobos module name.)


Denis
-- 
_________________
vita es estrany
spir.wikidot.com
Mar 27 2011
parent bearophile <bearophileHUGS lycos.com> writes:
spir:

 * The message is wrong: the error is precisely due to the fact no file 
 'algorithm.d' was found.
The D compilers need to produce good error messages. So I suggest you to perform a search in Bugzilla, if you don't find your problem there (I have a related bug there), then add a new Bugzilla entry. Bye, bearophile
Mar 27 2011