File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1328,7 +1328,7 @@ object Types {
1328
1328
val funType = defn.FunctionOf (
1329
1329
formals1 mapConserve (_.underlyingIfRepeated(mt.isJavaMethod)),
1330
1330
mt.nonDependentResultApprox, mt.isImplicitMethod && ! ctx.erasedTypes)
1331
- if (mt.isDependent) RefinedType (funType, nme.apply, mt)
1331
+ if (mt.isDependent && ! mt.isImplicitMethod ) RefinedType (funType, nme.apply, mt)
1332
1332
else funType
1333
1333
}
1334
1334
Original file line number Diff line number Diff line change @@ -719,10 +719,12 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
719
719
completeParams(params)
720
720
val params1 = params.map(typedExpr(_).asInstanceOf [ValDef ])
721
721
val resultTpt = typed(body)
722
- val companion = if (isImplicit) ImplicitMethodType else MethodType
723
- val mt = companion.fromSymbols(params1.map(_.symbol), resultTpt.tpe)
722
+ val mt = MethodType .fromSymbols(params1.map(_.symbol), resultTpt.tpe)
724
723
if (mt.isParamDependent)
725
- ctx.error(i " $mt is an illegal function type because it has inter-parameter dependencies " )
724
+ ctx.error(i " $mt is an illegal function type because it has inter-parameter dependencies " , tree.pos)
725
+ if (isImplicit)
726
+ ctx.error(i " dependent function type $mt may not be implicit " , tree.pos)
727
+
726
728
val resTpt = TypeTree (mt.nonDependentResultApprox).withPos(body.pos)
727
729
val typeArgs = params1.map(_.tpt) :+ resTpt
728
730
val tycon = TypeTree (funCls.typeRef)
You can’t perform that action at this time.
0 commit comments