MethodX is ambiguous

As in Java, method calls are resolved by searching for a "closest match" in the type hierarchy. If such a closest match is not unique, the call is ambiguous.

Example error

class A extends Element {
}
 
class B extends A { 
  predicate pred(A a, B omg ) { any() }
  predicate pred(B b, A a) { any() }
}
 
from B b1, B b2 where b1.pred(b1,b2) select b1

For the highlighted call to pred, either definition of pred is a match, and so an ambiguity is reported.

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