Closed KimBruce closed 8 years ago
Note that the message says "CheckerFailure". I think that it is coming from your checker, probably the requiretypes checker.
Yes, dotted classes should be removed soon.
Yes, I can see where in requiredTypes the message is generated, I just have no idea how it got that from walking the tree.
Maybe it's best to just wait until the dotted classes are removed and then see if the problem still shows up in that way. (I am appreciating getting the error as it helps me find those places that have not yet been updated.)
A dotted class introduces two object constructors. In the inner one, the programmer can write their own asString
method. For the outer one, the parser generates an asString
method that answers "foo class", where "foo" is the name before the dot. That method doesn't have a declared return type, so you get the message.
A possible fix would be to change requiredTypes to recognize this case and not generate a message.
If a program contains a "dotted" class name, the system returns a very unhelpful error message:
CheckerFailure: no return type given to declaration of method 'asString'. in "Vehicle" (line 9, column 1)
where line 9 is:
Obviously, no indication of an "asString" method anywhere!
Note the system used not to complain about dotted class names at all, so this is an improvement, but it is very misleading!