648 if (m1Abstract && !m2Abstract) return m2; |
648 if (m1Abstract && !m2Abstract) return m2; |
649 if (m2Abstract && !m1Abstract) return m1; |
649 if (m2Abstract && !m1Abstract) return m1; |
650 // both abstract or both concrete |
650 // both abstract or both concrete |
651 if (!m1Abstract && !m2Abstract) |
651 if (!m1Abstract && !m2Abstract) |
652 return new AmbiguityError(m1, m2); |
652 return new AmbiguityError(m1, m2); |
653 // check for same erasure |
653 // check that both signatures have the same erasure |
654 if (!types.isSameType(m1.erasure(types), m2.erasure(types))) |
654 if (!types.isSameTypes(m1.erasure(types).getParameterTypes(), |
|
655 m2.erasure(types).getParameterTypes())) |
655 return new AmbiguityError(m1, m2); |
656 return new AmbiguityError(m1, m2); |
656 // both abstract, neither overridden; merge throws clause and result type |
657 // both abstract, neither overridden; merge throws clause and result type |
657 Symbol result; |
658 Symbol result; |
658 Type result2 = mt2.getReturnType(); |
659 Type result2 = mt2.getReturnType(); |
659 if (mt2.tag == FORALL) |
660 if (mt2.tag == FORALL) |