File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1799,6 +1799,11 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
17991799 */
18001800 def tryInsertApplyOrImplicit (tree : Tree , pt : ProtoType )(fallBack : => Tree )(implicit ctx : Context ): Tree = {
18011801
1802+ def isMethod (tree : Tree ) = tree.tpe match {
1803+ case ref : TermRef => ref.denot.alternatives.forall(_.info.widen.isInstanceOf [MethodicType ])
1804+ case _ => false
1805+ }
1806+
18021807 def isSyntheticApply (tree : Tree ): Boolean = tree match {
18031808 case tree : Select => tree.getAttachment(InsertedApply ).isDefined
18041809 case Apply (fn, _) => fn.getAttachment(InsertedApply ).isDefined
@@ -1821,7 +1826,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
18211826 pt.markAsDropped()
18221827 tree
18231828 case _ =>
1824- if (isApplyProto(pt) || isSyntheticApply(tree)) tryImplicit
1829+ if (isApplyProto(pt) || isMethod(tree) || isSyntheticApply(tree)) tryImplicit
18251830 else tryEither(tryApply(_))((_, _) => tryImplicit)
18261831 }
18271832 }
You can’t perform that action at this time.
0 commit comments