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 {
13281328 val funType = defn.FunctionOf (
13291329 formals1 mapConserve (_.underlyingIfRepeated(mt.isJavaMethod)),
13301330 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)
13321332 else funType
13331333 }
13341334
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
719719 completeParams(params)
720720 val params1 = params.map(typedExpr(_).asInstanceOf [ValDef ])
721721 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)
724723 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+
726728 val resTpt = TypeTree (mt.nonDependentResultApprox).withPos(body.pos)
727729 val typeArgs = params1.map(_.tpt) :+ resTpt
728730 val tycon = TypeTree (funCls.typeRef)
You can’t perform that action at this time.
0 commit comments