2 ms·
I don't know about other compilers, but in D, the compiler can suggest simple typos, so you'd get something like "Undefined identifier testAdder, did you mean T
by skocznymroczny 5y ago
I don't know about other compilers, but in D, the compiler can suggest simple typos, so you'd get something like "Undefined identifier testAdder, did you mean TestAdder?".
I think such lists are very useful however. Back when I used C++, Parashift C++ FAQ https://www.parashift.com/c++-faq/ https://www.parashift.com/c++-faq/ was very helpful for me. It helps with trickier parts of C++, for example the "most vexing parse" which doesn't have obvious error messages.
- jaredsohn 5y agoRuby does similar: Run: class Foobar end f = Foobaz.new Output: NameError (uninitialized constant Foobaz) Did you mean? Foobar
- Doxin 5y agoD also dispenses advice with some errors. I've mostly ran into these when accidentally doing C-style type declarations. e.g. when you try to compile int foo[3]; The D compiler will tell you Error: instead of C-style syntax, use D-style `int[3] foo` Which makes D positively a delight to learn if you know C already.
- skocznymroczny 5y agoYes, there are some errors designed for people coming over from C. Similarly, (void)somePointer gives you an error saying "instead of C-style cast, use cast(void)somePointer instead".