X does not extend Y

The use of super can be qualified with a type. Such qualified use of super can only access direct super types.

Example error and correction

class ABC extends RefType {
    string foo() { Element.super.toString() = result }
    string toString() { result = "abc" }
}

Here the correction is simple, just replace the use of Element by RefType, or indeed it could be left out completely. Qualified super is sometimes necessary when a class has multiple super-classes, and we wish to single out a particular one.

Comments
Only registered users can write comments!
 
< Prev   Next >