@@ -572,7 +572,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
572572 def typedBlock (tree : untpd.Block , pt : Type )(implicit ctx : Context ) = track(" typedBlock" ) {
573573 val exprCtx = index(tree.stats)
574574 val stats1 = typedStats(tree.stats, ctx.owner)
575- val expr1 = typedExpr(tree.expr, pt)(exprCtx)
575+ val ept = if (tree.isInstanceOf [untpd.InfixOpBlock ]) pt else pt.notApplied
576+ val expr1 = typedExpr(tree.expr, ept)(exprCtx)
576577 ensureNoLocalRefs(
577578 assignType(cpy.Block (tree)(stats1, expr1), stats1, expr1), pt, localSyms(stats1))
578579 }
@@ -619,8 +620,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
619620
620621 def typedIf (tree : untpd.If , pt : Type )(implicit ctx : Context ) = track(" typedIf" ) {
621622 val cond1 = typed(tree.cond, defn.BooleanType )
622- val thenp1 = typed(tree.thenp, pt)
623- val elsep1 = typed(tree.elsep orElse (untpd.unitLiteral withPos tree.pos), pt)
623+ val thenp1 = typed(tree.thenp, pt.notApplied )
624+ val elsep1 = typed(tree.elsep orElse (untpd.unitLiteral withPos tree.pos), pt.notApplied )
624625 val thenp2 :: elsep2 :: Nil = harmonize(thenp1 :: elsep1 :: Nil )
625626 assignType(cpy.If (tree)(cond1, thenp2, elsep2), thenp2, elsep2)
626627 }
@@ -793,7 +794,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
793794 val selType = widenForMatchSelector(
794795 fullyDefinedType(sel1.tpe, " pattern selector" , tree.pos))
795796
796- val cases1 = typedCases(tree.cases, selType, pt)
797+ val cases1 = typedCases(tree.cases, selType, pt.notApplied )
797798 val cases2 = harmonize(cases1).asInstanceOf [List [CaseDef ]]
798799 assignType(cpy.Match (tree)(sel1, cases2), cases2)
799800 }
@@ -920,8 +921,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
920921 }
921922
922923 def typedTry (tree : untpd.Try , pt : Type )(implicit ctx : Context ): Try = track(" typedTry" ) {
923- val expr1 = typed(tree.expr, pt)
924- val cases1 = typedCases(tree.cases, defn.ThrowableType , pt)
924+ val expr1 = typed(tree.expr, pt.notApplied )
925+ val cases1 = typedCases(tree.cases, defn.ThrowableType , pt.notApplied )
925926 val finalizer1 = typed(tree.finalizer, defn.UnitType )
926927 val expr2 :: cases2x = harmonize(expr1 :: cases1)
927928 val cases2 = cases2x.asInstanceOf [List [CaseDef ]]
@@ -1535,8 +1536,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
15351536 }
15361537
15371538 /** If this tree is a select node `qual.name`, try to insert an implicit conversion
1538- * `c` around `qual` so that `c(qual).name` conforms to `pt`. If that fails
1539- * return `tree` itself.
1539+ * `c` around `qual` so that `c(qual).name` conforms to `pt`.
15401540 */
15411541 def tryInsertImplicitOnQualifier (tree : Tree , pt : Type )(implicit ctx : Context ): Option [Tree ] = ctx.traceIndented(i " try insert impl on qualifier $tree $pt" ) {
15421542 tree match {
0 commit comments