@@ -541,11 +541,11 @@ object RefChecks {
541541 || mbr.is(JavaDefined ) && hasJavaErasedOverriding(mbr)
542542
543543 def isImplemented (mbr : Symbol ) =
544- val mbrType = clazz.thisType.memberInfo(mbr )
544+ val mbrDenot = mbr.asSeenFrom( clazz.thisType)
545545 def isConcrete (sym : Symbol ) = sym.exists && ! sym.isOneOf(NotConcrete )
546546 clazz.nonPrivateMembersNamed(mbr.name)
547547 .filterWithPredicate(
548- impl => isConcrete(impl.symbol) && mbrType .matchesLoosely(impl.info ))
548+ impl => isConcrete(impl.symbol) && mbrDenot .matchesLoosely(impl))
549549 .exists
550550
551551 /** The term symbols in this class and its baseclasses that are
@@ -602,8 +602,10 @@ object RefChecks {
602602 }
603603
604604 for (member <- missing) {
605+ def showDclAndLocation (sym : Symbol ) =
606+ s " ${sym.showDcl} in ${sym.owner.showLocated}"
605607 def undefined (msg : String ) =
606- abstractClassError(false , s " ${member.showDcl } is not defined $msg" )
608+ abstractClassError(false , s " ${showDclAndLocation( member) } is not defined $msg" )
607609 val underlying = member.underlyingSymbol
608610
609611 // Give a specific error message for abstract vars based on why it fails:
@@ -641,13 +643,13 @@ object RefChecks {
641643 val abstractSym = pa.typeSymbol
642644 val concreteSym = pc.typeSymbol
643645 def subclassMsg (c1 : Symbol , c2 : Symbol ) =
644- s " : ${c1.showLocated} is a subclass of ${c2.showLocated}, but method parameter types must match exactly. "
646+ s " ${c1.showLocated} is a subclass of ${c2.showLocated}, but method parameter types must match exactly. "
645647 val addendum =
646648 if (abstractSym == concreteSym)
647649 (pa.typeConstructor, pc.typeConstructor) match {
648650 case (TypeRef (pre1, _), TypeRef (pre2, _)) =>
649- if (pre1 =:= pre2) " : their type parameters differ"
650- else " : their prefixes (i.e. enclosing instances) differ"
651+ if (pre1 =:= pre2) " their type parameters differ"
652+ else " their prefixes (i.e. enclosing instances) differ"
651653 case _ =>
652654 " "
653655 }
@@ -657,18 +659,22 @@ object RefChecks {
657659 subclassMsg(concreteSym, abstractSym)
658660 else " "
659661
660- undefined(s " \n (Note that ${pa.show} does not match ${pc.show}$addendum) " )
662+ undefined(s """
663+ |(Note that
664+ | parameter ${pa.show} in ${showDclAndLocation(underlying)} does not match
665+ | parameter ${pc.show} in ${showDclAndLocation(concrete.symbol)}
666+ | $addendum) """ .stripMargin)
661667 case xs =>
662668 undefined(
663669 if concrete.symbol.is(AbsOverride ) then
664- s " \n (The class implements ${concrete.showDcl } but that definition still needs an implementation) "
670+ s " \n (The class implements ${showDclAndLocation( concrete.symbol) } but that definition still needs an implementation) "
665671 else
666- s " \n (The class implements a member with a different type: ${concrete.showDcl }) " )
672+ s " \n (The class implements a member with a different type: ${showDclAndLocation( concrete.symbol) }) " )
667673 }
668674 case Nil =>
669675 undefined(" " )
670676 case concretes =>
671- undefined(s " \n (The class implements members with different types: ${concretes.map(_.showDcl )}% \n %) " )
677+ undefined(s " \n (The class implements members with different types: ${concretes.map(c => showDclAndLocation(c.symbol) )}% \n %) " )
672678 }
673679 }
674680 else undefined(" " )
0 commit comments