@@ -2555,7 +2555,7 @@ class MissingImplicitArgument(
25552555 where : String ,
25562556 paramSymWithMethodCallTree : Option [(Symbol , tpd.Tree )] = None ,
25572557 ignoredInstanceNormalImport : => Option [SearchSuccess ],
2558- ignoredConversions : => Iterable [TermRef ]
2558+ ignoredConversions : => Iterable [( TermRef , Iterable [ TermRef ]) ]
25592559 )(using Context ) extends TypeMsg (MissingImplicitArgumentID ), ShowMatchTrace (pt):
25602560
25612561 arg.tpe match
@@ -2744,12 +2744,18 @@ class MissingImplicitArgument(
27442744 // show all available additional info
27452745 def hiddenImplicitNote (s : SearchSuccess ) =
27462746 i " \n\n Note: ${s.ref.symbol.showLocated} was not considered because it was not imported with `import given`. "
2747- def noChainConversionsNote (ignoredConversions : Iterable [TermRef ]): Option [String ] =
2747+ def showImplicitAndConversions (imp : TermRef , convs : Iterable [TermRef ]) =
2748+ i " \n - ${imp.symbol.showDcl}${convs.map(c => " \n - " + c.symbol.showDcl).mkString}"
2749+ def noChainConversionsNote (ignoredConversions : Iterable [(TermRef , Iterable [TermRef ])]): Option [String ] = {
2750+ val convsFormatted = ignoredConversions.map{ (imp, convs) =>
2751+ i " \n - ${imp.symbol.showDcl}${convs.map(c => " \n - " + c.symbol.showDcl).mkString}"
2752+ }.mkString
27482753 Option .when(ignoredConversions.nonEmpty)(
27492754 i " \n\n Note: implicit conversions are not automatically applied to arguments of using clauses. " +
27502755 i " You will have to pass the argument explicitly. \n " +
2751- i " The following conversions in scope result in ${pt.show}: ${ignoredConversions.map(g => s " \n - ${g.symbol.showDcl} " ).mkString} "
2756+ i " The following conversions in scope result in ${pt.show}: $convsFormatted "
27522757 )
2758+ }
27532759 super .msgPostscript
27542760 ++ ignoredInstanceNormalImport.map(hiddenImplicitNote)
27552761 .orElse(noChainConversionsNote(ignoredConversions))
0 commit comments