We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 504a8cf commit 3ac72d2Copy full SHA for 3ac72d2
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -4192,10 +4192,11 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
4192
}
4193
4194
// convert function literal to SAM closure
4195
+ val pt1 = pt.stripFlexible
4196
tree match {
4197
case closure(Nil, id @ Ident(nme.ANON_FUN), _)
- if defn.isFunctionNType(wtp) && !defn.isFunctionNType(pt) =>
4198
- pt match {
+ if defn.isFunctionNType(wtp) && !defn.isFunctionNType(pt1) =>
4199
+ pt1 match {
4200
case SAMType(samMeth, samParent)
4201
if wtp <:< samMeth.toFunctionType(isJava = samParent.classSymbol.is(JavaDefined)) =>
4202
// was ... && isFullyDefined(pt, ForceDegree.flipBottom)
0 commit comments