Skip to content

Commit 816062f

Browse files
committed
Remove unnecessary SAM handling
1 parent 362beb5 commit 816062f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4236,11 +4236,10 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
42364236
}
42374237

42384238
// convert function literal to SAM closure
4239-
val pt1 = pt.stripFlexible
42404239
tree match {
42414240
case closure(Nil, id @ Ident(nme.ANON_FUN), _)
4242-
if defn.isFunctionNType(wtp) && !defn.isFunctionNType(pt1) =>
4243-
pt1 match {
4241+
if defn.isFunctionNType(wtp) && !defn.isFunctionNType(pt) =>
4242+
pt match {
42444243
case SAMType(samMeth, samParent)
42454244
if wtp <:< samMeth.toFunctionType(isJava = samParent.classSymbol.is(JavaDefined)) =>
42464245
// was ... && isFullyDefined(pt, ForceDegree.flipBottom)

0 commit comments

Comments
 (0)