#### §2.3.4.(a) Potential ambiguity

A potential ambiguity is given, if two role classes `R1` and `R2` exist such that

- `R1` and `R2` are played by the same base class `B`, and
- `R1` and `R2` have a common super role `R0`, which is also bound to a base class `B0`, and
- neither role class `R1` nor `R2` is a (indirect) sub-class of the other.

##### Note:

According to §2.1.(c), if `B` is distinct from `B0` it has to be a sub-class of `B0`.

##### Effect:

In this case the compiler issues a warning, stating that the `B` may not be liftable, because both role classes `R1` and `R2` are candidates and there is no reason to prefer one over the other.
If no potential ambiguity is detected, lifting will always be unambiguous.

In the above situation, trying to lift an instance of type `B` to the role type `R0` is an illegal lifting request. If `R0` is bound to the same base class `B` as its sub-roles `R1` and `R2` are, role `R0` is unliftable, meaning that no instance of `R0` can ever by obtained by lifting.

##### Example code (Potential Ambiguity):

1

    team class MyTeam {

2

      public class SuperRole playedBy MyBase {...}

3

      public class SubRoleA extends SuperRole {...}

4

      public class SubRoleB extends SuperRole {...}

5

    }