October 24, 2012 [Issue 4563] [module system] Error messages for missing package or missing name | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4563 --- Comment #10 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-10-24 10:21:54 PDT --- (In reply to comment #9) > test.d(1): Error: module bitmanips cannot be found. Ok, I'll implement a pull and see what others think about it. > (Unrelated: do you know why D error messages don't have an ending full stop "." as in correct English?) GCC and DMC don't add a period either. I think it's purely accidental, some tools do, others don't (and sometimes it's mixed). I don't mind such issues though. Personally I worry much more about things like this: void main() { void function(int x, int y, float z) funcC; void function(int x, float y, int z) funcD; funcC = funcD; } Error: cannot implicitly convert expression (funcD) of type void function(int x, float y, int z) to void function(int x, int y, float z) It would make it much easier to debug such cases if the error spanned multiple lines and aligned the types, for example: Error: cannot implicitly convert expression (funcD) of type void function(int x, float y, int z) to void function(int x, int y, float z) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 24, 2012 [Issue 4563] [module system] Error messages for missing package or missing name | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4563 --- Comment #11 from bearophile_hugs@eml.cc 2012-10-24 11:10:27 PDT --- (In reply to comment #10) > Ok, I'll implement a pull and see what others think about it. Thank you. > It would make it much easier to debug such cases if the error spanned multiple lines and aligned the types, for example: > > Error: cannot implicitly convert expression (funcD) of type void function(int x, float y, int z) to void function(int x, int y, float z) Better: Error: cannot implicitly convert expression (funcD) of type: void function(int x, float y, int z) to type: void function(int x, int y, float z) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 24, 2012 [Issue 4563] [module system] Error messages for missing package or missing name | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4563 --- Comment #12 from bearophile_hugs@eml.cc 2012-10-24 11:17:33 PDT --- (In reply to comment #10) > > test.d(1): Error: module bitmanips cannot be found. > > Ok, I'll implement a pull and see what others think about it. Or: test.d(1): Error: module 'bitmanips' cannot be found. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 24, 2012 [Issue 4563] [module system] Error messages for missing package or missing name | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4563 --- Comment #13 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-10-24 11:19:11 PDT --- (In reply to comment #11) > (In reply to comment #10) > > > Ok, I'll implement a pull and see what others think about it. > > Thank you. I think we can do even better: import foo.bar.doo; Now it's test.d(3): Error: module doo is in file 'foo\bar\doo.d' which cannot be read If 'foo' doesn't exist the error should probably be: test.d(3): Error: package 'foo' not found If 'bar' doesn't exist it should be: test.d(3): Error: package 'bar' not found in package 'foo' If 'doo' doesn't exist: test.d(3): Error: module 'doo' not found in package 'foo.bar' Also, we might consider doing informative spellchecker errors, e.g.: import std.stddio; test.d(3): Error: module 'stddio' not found in package 'std', did you mean 'stdio'? The above should probably try finding D modules that are similar to 'stddio', read their module declaration (because it might be different from the filename), and if the module declaration is similar to 'stddio' it should print that module name as a recommendation. import stdd.stdio; test.d(3): Error: package 'stdd' not found, did you mean 'std'? Here we might try finding non-empty folders with .d or .di files named similarly to 'stdd' and recommend such a folder. I don't know how hard this will be but I think it's worth pursuing. -- 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