[BLUEJ-136] Using 'instanceof' on inconvertible types in codepad yields bad error
The error message the codepad gives if you use 'instanceof' on inconvertible types is "Error: not a statement", which is quite counterintuitive.
Let's say I have a class hierarchy with FilledCircle extending Circle, and an unrelated class Point. If I have a Circle named unitCircle, I get: {noformat}
unitCircle instanceof Object true (boolean) unitCircle instanceof FilledCircle false (boolean) unitCircle instanceof Point Error: not a statement {noformat} Of course it's correct that it isn't a statement, but the real error here is actually that Circle and Point are inconvertible types.
Issue metadata
- Issue type: Bug
- Priority: Low
- Fix versions: 3.0.2