Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analyze object when selecting from package #21511

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
13 changes: 13 additions & 0 deletions compiler/test/dotc/neg-init-global-scala2-library-tasty.blacklist
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,16 @@ unapplySeq-implicit-arg.scala
unapplySeq-implicit-arg2.scala
unapplySeq-implicit-arg3.scala
ScalaCheck.scala
mutable-read8.scala
TypeCast.scala
global-cycle8.scala
global-cycle6.scala
i12544b.scala
t9360.scala
mutable-array.scala
patmat-unapplySeq2.scala
line-spacing.scala
global-list.scala
t5366.scala
mutable-read7.scala
t9115.scala
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
}
Loading