gracelang / minigrace

Self-hosting compiler for the Grace programming language
39 stars 22 forks source link

Bad error message #223

Closed KimBruce closed 7 years ago

KimBruce commented 8 years ago

Defining a class with a "dotted" name (e.g., as in old style class definitions) gives a very misleading error message. E.g., writing

class appleGameDisplay.apples (numApples: Number) on (canvas: DrawingCanvas) 
                          -> AppleGameDisplay

gives the error message:

CheckerFailure: no return type given to declaration of method 'asString'.
    in "AppleGameDisplay" (line 23, column 1)

This is an issue with the requiredTypes dialect rather than the minigrace compiler itself.

apblack commented 7 years ago

The above example now generates:

Syntax error: dotted classes are no longer supported. Consider using a class, or a class inside an object constructor.
    in "#223" (line 1, column 23)