Skip to content

Fix issue with pc breaking in requiredMethod on newly overloaded valueOf #23708

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -734,15 +734,18 @@ class Completions(
defn.Object_notifyAll,
defn.Object_notify,
defn.Predef_undefined,
defn.ObjectClass.info.member(nme.wait_).symbol,
// NOTE(olafur) IntelliJ does not complete the root package and without this filter
// then `_root_` would appear as a completion result in the code `foobar(_<COMPLETE>)`
defn.RootPackage,
// NOTE(gabro) valueOf was added as a Predef member in 2.13. We filter it out since is a niche
// use case and it would appear upon typing 'val'
defn.ValueOfClass.info.member(nme.valueOf).symbol,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ValueOf.valueOf does not exist and going by the comment, it seems that the ValueOf class was meant to be filtered here instead, so I changed this.

defn.ScalaPredefModule.requiredMethod(nme.valueOf)
).flatMap(_.alternatives.map(_.symbol)).toSet
defn.ValueOfClass
) ++ (
Set(
defn.ObjectClass.info.member(nme.wait_),
defn.ScalaPredefModule.info.member(nme.valueOf)
).flatMap(_.alternatives.map(_.symbol)).toSet
)

private def isNotLocalForwardReference(sym: Symbol)(using Context): Boolean =
!sym.isLocalToBlock ||
Expand Down
Loading