@@ -310,12 +310,15 @@ object Denotations {
310
310
}
311
311
case tp1 : MethodOrPoly =>
312
312
tp2 match {
313
- case tp2 : MethodOrPoly
314
- if ctx.typeComparer.matchingParams(tp1, tp2) &&
315
- tp1.isImplicit == tp2.isImplicit =>
316
- tp1.derivedLambdaType(
317
- mergeParamNames(tp1, tp2), tp1.paramInfos,
318
- infoMeet(tp1.resultType, tp2.resultType.subst(tp2, tp1)))
313
+ case tp2 : MethodOrPoly =>
314
+ if (tp1.isInstanceOf [PolyType ] && tp2.isInstanceOf [MethodType ]) tp2
315
+ else if (tp2.isInstanceOf [PolyType ] && tp1.isInstanceOf [MethodType ]) tp1
316
+ else if (ctx.typeComparer.matchingParams(tp1, tp2) &&
317
+ tp1.isImplicit == tp2.isImplicit)
318
+ tp1.derivedLambdaType(
319
+ mergeParamNames(tp1, tp2), tp1.paramInfos,
320
+ infoMeet(tp1.resultType, tp2.resultType.subst(tp2, tp1)))
321
+ else mergeConflict(tp1, tp2)
319
322
case _ =>
320
323
mergeConflict(tp1, tp2)
321
324
}
@@ -553,7 +556,7 @@ object Denotations {
553
556
if (sd1.exists)
554
557
if (sd2.exists)
555
558
if (isDoubleDef(denot1.symbol, denot2.symbol)) doubleDefError(denot1, denot2)
556
- else throw new TypeError (s " failure to disambiguate overloaded reference $this" )
559
+ else throw new TypeError (i " failure to disambiguate overloaded reference at $this" )
557
560
else sd1
558
561
else sd2
559
562
}
0 commit comments