File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
compiler/src/dotty/tools/dotc/typer
tests/neg-custom-args/captures Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2030,7 +2030,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
20302030 case mt : MethodType =>
20312031 pt.findFunctionType match {
20322032 case SAMType (samMeth, samParent)
2033- if ! defn.isFunctionNType(samParent) && mt <:< samMeth =>
2033+ if ! ctx.erasedTypes && ! defn.isFunctionNType(samParent)
2034+ && mt <:< samMeth && ! mt.isImplicitMethod =>
20342035 if defn.isContextFunctionType(mt.resultType) then
20352036 report.error(
20362037 em """ Implementation restriction: cannot convert this expression to ` $samParent`
Original file line number Diff line number Diff line change 1+ abstract class MyFun :
2+ def apply (x : Int ): Int
3+
4+ object Test :
5+ val myFun : MyFun = (x : Int ) ?=> x + 10 // error
You can’t perform that action at this time.
0 commit comments