A consistent, generic error? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

A consistent, generic error?

Hi all, I'm quite used to having error messages coming out of my ears when I work on code, but recently a project I'm working on on sololearn has been giving me a generic "Compilation error" every time I try to run it. I think it started after I added the constructors to my 'Player' and 'Character' classes (player inherits from character), and although I've gone through them to correct any issues I could find, it still gives me the same generic error message, so I have no way of knowing what I've done wrong :S. I also can't try the code in a proper IDE, as I don't have a proper computer, only an old tablet, Any help with this would be greatly appreciated! Thanks. Link to code: https://code.sololearn.com/cyw0D7lQ05r4/#cs

3rd Jun 2018, 8:45 PM
Robbie Humbucker
Robbie Humbucker - avatar
2 Answers
+ 3
I don't know why it doesn't give a full error list sometimes. But I did three fixes that got the error list to come up: 1. Added semicolons to the end of each enum. 2. ToLower() is a method, and it's missing parentheses in a few places in Main(). 3. Some of your class setters have "private set" instead of just "set" (mostly in Gender). If you'd like anymore help, or to see the partially fixed code, let me know! 😀
4th Jun 2018, 12:06 AM
Tamra
Tamra - avatar
+ 2
@Tamra ooh man, that's quite some list of errors that I've got now! 😂 Many thanks for your help, re-adding the parantheses in main was enough to get the error list back up for me. Before I added the constructors, I had the program working properly with the enums and the private sets as you found them, but I'll keep that in mind...I don't know how I missed those ToLower methods, though, that was such a clumsy mistake! The compiler must just have been unable to comprehend how I could be that stupid 😂 EDIT: Oh my....Oh my goodness....OH MY GOODNESS. I forgot to tag 'player' as inheriting from 'character' 😂😂😂 I can't believe I've spent so long debugging this program without noticing that 😂 Thanks again for your help, I probably never would have found out if it wasn't for all those "Player does not contain a definition for...." errors 😂 I wonder if maybe sololearn is only capable of displaying a certain number of errors? There are certainly enough there that I might have maxed it out :D
4th Jun 2018, 3:02 PM
Robbie Humbucker
Robbie Humbucker - avatar