@@ -2158,14 +2158,12 @@ class Typer extends Namer
21582158 false
21592159 }
21602160
2161- def adaptToArgs (wtp : Type , pt : FunProto ): Tree = wtp match {
2162- case _ : MethodOrPoly =>
2161+ def adaptToArgs (wtp : Type , pt : FunProto ): Tree = wtp.toLambda match {
2162+ case _ : LambdaType =>
21632163 if (pt.args.lengthCompare(1 ) > 0 && isUnary(wtp) && ctx.canAutoTuple)
21642164 adapt(tree, pt.tupled, locked)
21652165 else
21662166 tree
2167- case wtp : TypeRef if wtp.underlying.hiBound.isInstanceOf [HKLambda ] =>
2168- tree
21692167 case _ => tryInsertApplyOrImplicit(tree, pt, locked) {
21702168 errorTree(tree, MethodDoesNotTakeParameters (tree))
21712169 }
@@ -2489,8 +2487,9 @@ class Typer extends Namer
24892487 }
24902488
24912489 def adaptType (tp : Type ): Tree = {
2490+ val isApplied = pt `eq` AnyTypeConstructorProto
24922491 val tree1 =
2493- if ((pt eq AnyTypeConstructorProto ) || tp.typeParamSymbols.isEmpty) tree
2492+ if (isApplied || tp.typeParamSymbols.isEmpty) tree
24942493 else {
24952494 val tp1 =
24962495 if (ctx.compilationUnit.isJava)
@@ -2507,7 +2506,7 @@ class Typer extends Namer
25072506 case pt : TypeBounds if ctx.mode `is` Mode .Type => pt `contains` tree1.tpe
25082507 case _ => tree1.tpe <:< pt
25092508 }
2510- if (Inliner .isInlineable(tree.symbol))
2509+ if (! isApplied && Inliner .isInlineable(tree.symbol))
25112510 readaptSimplified {
25122511 Inliner .inlineCall(tree, pt) match {
25132512 case inlined : Inlined => TypeTree (inlined.tpe).withPos(tree.pos)
0 commit comments