Skip to content

Commit cff451a

Browse files
authored
Merge pull request #561 from scala/backport-lts-3.3-23708
Backport "Fix issue with pc breaking in requiredMethod on newly overloaded valueOf" to 3.3 LTS
2 parents 8b1d9ad + b82dabc commit cff451a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,15 +736,18 @@ class Completions(
736736
defn.Object_notifyAll,
737737
defn.Object_notify,
738738
defn.Predef_undefined,
739-
defn.ObjectClass.info.member(nme.wait_).symbol,
740739
// NOTE(olafur) IntelliJ does not complete the root package and without this filter
741740
// then `_root_` would appear as a completion result in the code `foobar(_<COMPLETE>)`
742741
defn.RootPackage,
743742
// NOTE(gabro) valueOf was added as a Predef member in 2.13. We filter it out since is a niche
744743
// use case and it would appear upon typing 'val'
745-
defn.ValueOfClass.info.member(nme.valueOf).symbol,
746-
defn.ScalaPredefModule.requiredMethod(nme.valueOf)
747-
).flatMap(_.alternatives.map(_.symbol)).toSet
744+
defn.ValueOfClass
745+
) ++ (
746+
Set(
747+
defn.ObjectClass.info.member(nme.wait_),
748+
defn.ScalaPredefModule.info.member(nme.valueOf)
749+
).flatMap(_.alternatives.map(_.symbol)).toSet
750+
)
748751

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

presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSuite.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ class CompletionSuite extends BaseCompletionSuite:
128128
|isInstanceOf[X0]: Boolean
129129
|synchronized[X0](x$0: X0): X0
130130
|toString(): String
131-
|wait(): Unit
132-
|wait(x$0: Long): Unit
133-
|wait(x$0: Long, x$1: Int): Unit
134131
|""".stripMargin
135132
)
136133

0 commit comments

Comments
 (0)