Skip to content

Commit 3508d33

Browse files
committed
Simplify summarization logic
Now we handle the semantics of object access during checking.
1 parent 8bdd645 commit 3508d33

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

compiler/src/dotty/tools/dotc/transform/init/Summarization.scala

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,9 @@ object Summarization {
245245
if tmref.symbol.is(Flags.Module, butNot = Flags.Package)
246246
&& tmref.symbol.isStatic
247247
=>
248-
val cls = tmref.symbol.moduleClass
249-
if cls == env.ctx.owner.lexicallyEnclosingClass then
250-
// self reference to an object inside the object
251-
Summary(ThisRef()(source))
252-
else
253-
val enclosing = env.ctx.owner.lexicallyEnclosingClass.asClass
254-
val pot = Global(tmref.symbol, enclosing)(source)
255-
Summary(pot) + AccessGlobal(pot)
248+
val enclosing = env.ctx.owner.lexicallyEnclosingClass.asClass
249+
val pot = Global(tmref.symbol, enclosing)(source)
250+
Summary(pot) + AccessGlobal(pot)
256251

257252
case tmref: TermRef =>
258253
val Summary(pots, effs) = analyze(tmref.prefix, source)

0 commit comments

Comments
 (0)