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

Multiple (non-implicit) parameters to a symbolic/infix should be avoided #10221

Closed
octonato opened this issue Apr 24, 2020 · 5 comments · Fixed by #11672
Closed

Multiple (non-implicit) parameters to a symbolic/infix should be avoided #10221

octonato opened this issue Apr 24, 2020 · 5 comments · Fixed by #11672

Comments

@octonato
Copy link
Contributor

In #10199 we added symbolic methods to TypeMap, but as signaled by @NthPortal we should avoid this.

Triggered by:

I'm a bit late to the party here, but multiple (non-implicit) parameters to a symbolic/infix method are highly discouraged, and planned to be deprecated. See scala/scala-dev#496 and scala/scala3#4311 (comment).

Originally posted by @NthPortal in #10199

@octonato
Copy link
Contributor Author

From my part we can remove all the new symbolic operators.

@octonato octonato added this to the Play 2.x milestone Apr 24, 2020
@mkurz
Copy link
Member

mkurz commented Apr 24, 2020

... we added symbolic methods ... but ... we should avoid this

Just to make things clear, not symbolic methods should be avoided, but multi-params for this methods.

@octonato
Copy link
Contributor Author

Yes, but we will have an imbalance in the API if we remove only a those with multi-params.

@mkurz mkurz modified the milestones: Play 2.x, 2.9.0 Feb 11, 2022
@BillyAutrey BillyAutrey self-assigned this Feb 15, 2023
@BillyAutrey
Copy link
Member

So for this task, I'm planning to deprecate first (to prevent sudden usage breaks). Do we want to remove all of the postfix symbol operators and refer back to updated?

Also, should I add multiple signatures for updated to match the convenience signatures here? E.g.:

def updated(entries: TypedEntry[_]*): TypedMap

@BillyAutrey
Copy link
Member

In #11672, I opted to do the following:

  • Add multiple signatures for updated, to reflect all the current usages of +
  • Also, add the same signatures for removed, to have parity for - functionality.
  • Mark + and - methods as deprecated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment