Skip to content
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
4 changes: 4 additions & 0 deletions compiler/src/dotty/tools/dotc/transform/init/Util.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ object Util:
case TypeApply(fn, targs) =>
unapply(fn)

case ref: RefTree if ref.symbol.is(Flags.Method) =>
Some((ref, Nil))

case ref: RefTree if ref.tpe.widenSingleton.isInstanceOf[MethodicType] =>
// for polymorphic method with no `apply` symbol; see tests/init/pos/interleaving-overload.scala
Some((ref, Nil))

case _ => None
Expand Down
7 changes: 7 additions & 0 deletions tests/init-global/pos-tasty/test-safe-value.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package scala.collection.immutable

object A { // These are a safe values, so no warning should be emitted
Node.HashCodeLength
Node.BitPartitionSize
Node.MaxDepth
}
Loading