File tree 1 file changed +1
-20
lines changed
compiler/src/dotty/tools/dotc/typer
1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change @@ -934,25 +934,6 @@ trait Implicits:
934
934
case _ => false
935
935
}
936
936
937
- /** Whether a found implicit be converted to the desired type */
938
- def canBeConverted (ref : TermRef , expected : Type ): Boolean = {
939
- // Using Mode.Printing will stop it from printing errors
940
- val tried = Contexts .withMode(Mode .Printing ) {
941
- typed(
942
- tpd.ref(ref).withSpan(arg.span),
943
- expected,
944
- ctx.typerState.ownedVars
945
- )
946
- }
947
- val hasErrors =
948
- if tried.tpe.isInstanceOf [ErrorType ] then true
949
- else tried match {
950
- case Apply (_, List (arg)) => arg.tpe.isInstanceOf [ErrorType ]
951
- case _ => false
952
- }
953
- ! hasErrors && expected =:= tried.tpe
954
- }
955
-
956
937
def ignoredConvertibleImplicits = arg.tpe match
957
938
case fail : SearchFailureType =>
958
939
if (fail.expectedType eq pt) || isFullyDefined(fail.expectedType, ForceDegree .none) then
@@ -964,7 +945,7 @@ trait Implicits:
964
945
.filter { imp =>
965
946
! isImplicitDefConversion(imp.underlying)
966
947
&& imp.symbol != defn.Predef_conforms
967
- && canBeConverted (imp, fail.expectedType)
948
+ && viewExists (imp, fail.expectedType)
968
949
}
969
950
else
970
951
Nil
You can’t perform that action at this time.
0 commit comments