We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e78493 commit c717bfeCopy full SHA for c717bfe
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -4198,10 +4198,11 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
4198
}
4199
4200
// convert function literal to SAM closure
4201
+ val pt1 = pt.stripFlexible
4202
tree match {
4203
case closure(Nil, id @ Ident(nme.ANON_FUN), _)
- if defn.isFunctionNType(wtp) && !defn.isFunctionNType(pt) =>
4204
- pt match {
+ if defn.isFunctionNType(wtp) && !defn.isFunctionNType(pt1) =>
4205
+ pt1 match {
4206
case SAMType(sam)
4207
if wtp <:< sam.toFunctionType(isJava = pt.classSymbol.is(JavaDefined)) =>
4208
// was ... && isFullyDefined(pt, ForceDegree.flipBottom)
0 commit comments