Skip to content

Commit 0ec539a

Browse files
committed
Remove s.type from synthesized isInstanceOf`
1 parent 3356dcf commit 0ec539a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
5757
else if sym2 == defn.AnyValClass || sym2 == defn.AnyRefAlias || sym2 == defn.ObjectClass then
5858
EmptyTree
5959
else
60-
// Generate SAM: (s: <tp1>) => if s.isInstanceOf[s.type & <tp2>] then Some(s.asInstanceOf[s.type & <tp2>]) else None
60+
// Generate SAM: (s: <tp1>) => if s.isInstanceOf[<tp2>] then Some(s.asInstanceOf[s.type & <tp2>]) else None
6161
def body(args: List[Tree]): Tree = {
6262
val arg :: Nil = args
6363
val t = arg.tpe & tp2
6464
If(
65-
arg.select(defn.Any_isInstanceOf).appliedToType(t),
65+
arg.select(defn.Any_isInstanceOf).appliedToType(tp2),
6666
ref(defn.SomeClass.companionModule.termRef).select(nme.apply)
6767
.appliedToType(t)
6868
.appliedTo(arg.select(nme.asInstanceOf_).appliedToType(t)),

0 commit comments

Comments
 (0)