Constructor named X expected

The name of the constructor must match the name of the class.

Example error and correction

class X extends Element {
   Y() { @method(this) }
}
Here Y should be renamed to X. Alternatively, it might be that the intention was to define a predicate named Y, but as in that case we must give Y an identifier that starts with a lowercase letter:
class X extends Element {
   predicate y() { @method(this) }
}
Comments
Only registered users can write comments!
 
< Prev   Next >