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 362beb5 commit 816062fCopy full SHA for 816062f
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -4236,11 +4236,10 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
4236
}
4237
4238
// convert function literal to SAM closure
4239
- val pt1 = pt.stripFlexible
4240
tree match {
4241
case closure(Nil, id @ Ident(nme.ANON_FUN), _)
4242
- if defn.isFunctionNType(wtp) && !defn.isFunctionNType(pt1) =>
4243
- pt1 match {
+ if defn.isFunctionNType(wtp) && !defn.isFunctionNType(pt) =>
+ pt match {
4244
case SAMType(samMeth, samParent)
4245
if wtp <:< samMeth.toFunctionType(isJava = samParent.classSymbol.is(JavaDefined)) =>
4246
// was ... && isFullyDefined(pt, ForceDegree.flipBottom)
0 commit comments