Skip to content

Commit 551816b

Browse files
yilinweiWojciechMazur
authored andcommitted
Add extra predicate check in canBeInvalidated
[Cherry-picked c532dd7]
1 parent 5ce99ef commit 551816b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2442,7 +2442,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
24422442
def canBeInvalidated(sym: Symbol): Boolean =
24432443
sym.is(Synthetic)
24442444
&& (desugar.isRetractableCaseClassMethodName(sym.name) ||
2445-
sym.owner.derivesFrom(defn.JavaRecordClass))
2445+
(sym.owner.is(JavaDefined) && sym.owner.derivesFrom(defn.JavaRecordClass)))
24462446

24472447
if !sym.info.exists then
24482448
// it's a discarded method (synthetic case class method or synthetic java record constructor or overriden member), drop it

0 commit comments

Comments
 (0)