Skip to content

Commit c532dd7

Browse files
committed
Add extra predicate check in canBeInvalidated
1 parent 47511ae commit c532dd7

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
@@ -2548,7 +2548,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
25482548
def canBeInvalidated(sym: Symbol): Boolean =
25492549
sym.is(Synthetic)
25502550
&& (desugar.isRetractableCaseClassMethodName(sym.name) ||
2551-
sym.owner.derivesFrom(defn.JavaRecordClass))
2551+
(sym.owner.is(JavaDefined) && sym.owner.derivesFrom(defn.JavaRecordClass)))
25522552

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

0 commit comments

Comments
 (0)