Skip to content

Commit e9ff396

Browse files
committed
Revert changes to ExpandSAMs
They amounted to a double change owner operation
1 parent d633b2e commit e9ff396

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ class ExpandSAMs extends MiniPhase:
157157
cpy.CaseDef(cdef)(body = tru).changeOwner(anonSym, isDefinedAtFn)
158158
val paramRef = paramRefss.head.head
159159
val defaultValue = Literal(Constant(false))
160-
translateMatch(pfRHS.changeOwner(anonSym, isDefinedAtFn), paramRef.symbol, pfRHS.cases.map(translateCase), defaultValue)
160+
translateMatch(pfRHS, paramRef.symbol, pfRHS.cases.map(translateCase), defaultValue)
161161
}
162162

163163
def applyOrElseRhs(paramRefss: List[List[Tree]])(using Context) = {
164164
val List(paramRef, defaultRef) = paramRefss(1)
165165
def translateCase(cdef: CaseDef) =
166166
cdef.changeOwner(anonSym, applyOrElseFn)
167167
val defaultValue = defaultRef.select(nme.apply).appliedTo(paramRef)
168-
translateMatch(pfRHS.changeOwner(anonSym, applyOrElseFn), paramRef.symbol, pfRHS.cases.map(translateCase), defaultValue)
168+
translateMatch(pfRHS, paramRef.symbol, pfRHS.cases.map(translateCase), defaultValue)
169169
}
170170

171171
val constr = newConstructor(pfSym, Synthetic, Nil, Nil).entered

0 commit comments

Comments
 (0)