File tree 2 files changed +5
-1
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -777,7 +777,7 @@ class Typer extends Namer
777
777
completeParams(params)
778
778
val params1 = params.map(typedExpr(_).asInstanceOf [ValDef ])
779
779
val resultTpt = typed(body)
780
- val companion = if (isImplicit) ImplicitMethodType else MethodType
780
+ val companion = MethodType .maker (isImplicit = isImplicit, isErased = isErased)
781
781
val mt = companion.fromSymbols(params1.map(_.symbol), resultTpt.tpe)
782
782
if (mt.isParamDependent)
783
783
ctx.error(i " $mt is an illegal function type because it has inter-parameter dependencies " , tree.pos)
Original file line number Diff line number Diff line change
1
+ object Test {
2
+ def foo : (erased (x : Int , y : Int ) => Int ) = erased (x, y) => 1
3
+ def bar : (erased implicit (x : Int , y : Int ) => Int ) = erased implicit (x, y) => 1
4
+ }
You can’t perform that action at this time.
0 commit comments