Skip to content

Commit

Permalink
analyze object when selecting from package
Browse files Browse the repository at this point in the history
  • Loading branch information
EnzeXing committed Aug 29, 2024
1 parent d490d13 commit 76ae609
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/init/Objects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ class Objects(using Context @constructorOnly):
Bottom

case Bottom =>
if field.isStaticObject then ObjectRef(field.moduleClass.asClass)
if field.isStaticObject then accessObject(field.moduleClass.asClass)
else Bottom

case ValueSet(values) =>
Expand Down
9 changes: 9 additions & 0 deletions tests/init-global/warn/cyclic-object.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package cyclicObject

object O1 { // warn
val o = cyclicObject.O2
}

object O2 {
val o = cyclicObject.O1
}

0 comments on commit 76ae609

Please sign in to comment.