'super' is ambiguous because X extends more than one type

A class can extend multiple super types. When that happens, it is not clear what the variable super refers to, and an ambiguity is reported.

Example error and correction

class A extends Member, Method {
  string toString() { result = super.toString() }
}

Here super might refer either to Member or to Method. You can specify which one you want by qualifying the super call:

class A extends Member, Method {
  string toString() { result = Member.super.toString() }
}
Comments
Only registered users can write comments!
 
< Prev   Next >