Skip to content

Commit 9e65352

Browse files
oderskysmarter
authored andcommitted
Make sure bringForward returns a denotation valid in current period
There was a scenario in the IDE where this was not the case: If the owner of a denotation was deleted in the new run, the old symbol gets an updated validity. Then, a call to bringForward of a member of that invalid owner will lookup the symbol in its owner, yielding itself. But the validity still was the previous period.
1 parent 4d4d083 commit 9e65352

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/Denotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ object Denotations {
791791
lazy val staleOK = ctx.acceptStale(symd)
792792
if (ctx.settings.YupdateStale.value && symd.owner.is(Package) || staleOK) {
793793
val newd = symd.owner.info.decls.lookup(symd.name)
794-
if (newd.exists) return newd
794+
if (newd.exists) return (newd.denot: SingleDenotation).updateValidity()
795795
else if (staleOK) return updateValidity()
796796
}
797797
case _ =>

0 commit comments

Comments
 (0)