Skip to content

Commit c765967

Browse files
committed
Fix issue with pc breaking in requiredMethod on newly overloaded valueOf
1 parent a85c429 commit c765967

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -734,15 +734,18 @@ class Completions(
734734
defn.Object_notifyAll,
735735
defn.Object_notify,
736736
defn.Predef_undefined,
737-
defn.ObjectClass.info.member(nme.wait_).symbol,
738737
// NOTE(olafur) IntelliJ does not complete the root package and without this filter
739738
// then `_root_` would appear as a completion result in the code `foobar(_<COMPLETE>)`
740739
defn.RootPackage,
741-
// NOTE(gabro) valueOf was added as a Predef member in 2.13. We filter it out since is a niche
742-
// use case and it would appear upon typing 'val'
743-
defn.ValueOfClass.info.member(nme.valueOf).symbol,
744-
defn.ScalaPredefModule.requiredMethod(nme.valueOf)
745-
).flatMap(_.alternatives.map(_.symbol)).toSet
740+
) ++ (
741+
Set(
742+
defn.ObjectClass.info.member(nme.wait_),
743+
// NOTE(gabro) valueOf was added as a Predef member in 2.13. We filter it out since is a niche
744+
// use case and it would appear upon typing 'val'
745+
defn.ValueOfClass.info.member(nme.valueOf),
746+
defn.ScalaPredefModule.info.member(nme.valueOf)
747+
).flatMap(_.alternatives.map(_.symbol)).toSet
748+
)
746749

747750
private def isNotLocalForwardReference(sym: Symbol)(using Context): Boolean =
748751
!sym.isLocalToBlock ||

0 commit comments

Comments
 (0)