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

Support contextual parameters in scala3 #191

Open
prolativ opened this issue Jul 16, 2021 · 2 comments
Open

Support contextual parameters in scala3 #191

prolativ opened this issue Jul 16, 2021 · 2 comments
Labels
scala3 Related to scala 3 engine

Comments

@prolativ
Copy link

A method like

def foo(using Foo): Bar

should be searchable as Foo ?=> Bar

@KacperFKorban KacperFKorban added the scala3 Related to scala 3 engine label Jul 16, 2021
@KacperFKorban
Copy link
Member

In my opinion, this is a tricky one and that's why I'll probably leave it for a future release.
In this case Foo ?=> Bar seems like the correct signature, but let's take another example >>= in cats.
For a query List[A] => (A => List[B]) => List[B] one should expect for >>= to be a valid result, but in order to achieve that some sort of implicit instances lookup would be neccessary.

@KacperFKorban KacperFKorban added this to the 1.0.0-M3 milestone Aug 3, 2021
@KacperFKorban KacperFKorban removed this from the 1.0.0-M3 milestone Aug 12, 2021
@KacperFKorban
Copy link
Member

New idea: The true/false matching phase should not check context parameters. There are too many cases to distinguish from and could affect performance too much.
The new sorting phase should group searches based on:

  • if the context parameter exists in (companion object or standard package or static import)
  • if the context parameter is defined in the query e.g. query like Context ?=> ValDef => Symbol
  • if no such criterium is met
    ^^^^^^ may not be exhaustive, new cases may be needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scala3 Related to scala 3 engine
Projects
None yet
Development

No branches or pull requests

2 participants