@@ -715,7 +715,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
715
715
}
716
716
val funCls = defn.FunctionClass (args.length, isImplicit)
717
717
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 = {
719
720
completeParams(params)
720
721
val params1 = params.map(typedExpr(_).asInstanceOf [ValDef ])
721
722
val resultTpt = typed(body)
@@ -744,8 +745,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
744
745
}
745
746
746
747
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
749
749
750
750
pt match {
751
751
case pt : TypeVar if untpd.isFunctionWithUnknownParamType(tree) =>
@@ -837,7 +837,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
837
837
}
838
838
case _ =>
839
839
}
840
- errorType(AnonymousFunctionMissingParamType (param, args , tree, pt), param.pos)
840
+ errorType(AnonymousFunctionMissingParamType (param, params , tree, pt), param.pos)
841
841
}
842
842
843
843
def protoFormal (i : Int ): Type =
@@ -1721,7 +1721,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1721
1721
}
1722
1722
1723
1723
protected def makeImplicitFunction (tree : untpd.Tree , pt : Type )(implicit ctx : Context ): Tree = {
1724
- val defn .FunctionOf (formals, _, true ) = pt.dealias. dropDependentRefinement
1724
+ val defn .FunctionOf (formals, _, true ) = pt.dropDependentRefinement
1725
1725
val paramTypes = formals.map(fullyDefinedType(_, " implicit function parameter" , tree.pos))
1726
1726
val ifun = desugar.makeImplicitFunction(paramTypes, tree)
1727
1727
typr.println(i " make implicit function $tree / $pt ---> $ifun" )
0 commit comments