@@ -715,7 +715,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
715715 }
716716 val funCls = defn.FunctionClass (args.length, isImplicit)
717717
718- def typedDependent (params : List [ValDef ])(implicit ctx : Context ) = {
718+ /** Typechecks dependent function type with given parameters `params` */
719+ def typedDependent (params : List [ValDef ])(implicit ctx : Context ): Tree = {
719720 completeParams(params)
720721 val params1 = params.map(typedExpr(_).asInstanceOf [ValDef ])
721722 val resultTpt = typed(body)
@@ -744,8 +745,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
744745 }
745746
746747 def typedFunctionValue (tree : untpd.Function , pt : Type )(implicit ctx : Context ) = {
747- val untpd .Function (args, body) = tree
748- val params = args.asInstanceOf [List [untpd.ValDef ]]
748+ val untpd .Function (params : List [untpd.ValDef ], body) = tree
749749
750750 pt match {
751751 case pt : TypeVar if untpd.isFunctionWithUnknownParamType(tree) =>
@@ -837,7 +837,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
837837 }
838838 case _ =>
839839 }
840- errorType(AnonymousFunctionMissingParamType (param, args , tree, pt), param.pos)
840+ errorType(AnonymousFunctionMissingParamType (param, params , tree, pt), param.pos)
841841 }
842842
843843 def protoFormal (i : Int ): Type =
@@ -1714,7 +1714,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
17141714 }
17151715
17161716 protected def makeImplicitFunction (tree : untpd.Tree , pt : Type )(implicit ctx : Context ): Tree = {
1717- val defn .FunctionOf (formals, _, true ) = pt.dealias. dropDependentRefinement
1717+ val defn .FunctionOf (formals, _, true ) = pt.dropDependentRefinement
17181718 val paramTypes = formals.map(fullyDefinedType(_, " implicit function parameter" , tree.pos))
17191719 val ifun = desugar.makeImplicitFunction(paramTypes, tree)
17201720 typr.println(i " make implicit function $tree / $pt ---> $ifun" )
0 commit comments