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

Use '? super A' for Function parameter in Promise.map and Promise.flatMap #826

Closed
tombeck opened this issue Mar 11, 2013 · 3 comments
Closed

Comments

@tombeck
Copy link

tombeck commented Mar 11, 2013

It's currently not possible to call 'map' or 'flatMap' on a Promise of type Promise<? extends A>.

Changing the signature from

    public <B> Promise<B> map(final Function<A, B> function) 

to

    public <B> Promise<B> map(final Function<? super A, B> function)

would solve the issue without breaking existing code.
'flatMap' should be changed accordingly.

@jroper
Copy link
Member

jroper commented Mar 12, 2013

Absolutely this should be done, but we are looking at replacing the Java Promise API with the Scala Future API plus some of the sugar from Akka futures for working with futures with Java. That will resolve this issue.

@tombeck
Copy link
Author

tombeck commented Mar 12, 2013

Is there a deadline for that change?

danielberndt pushed a commit to patiencelabs/Play20 that referenced this issue Mar 13, 2013
danielberndt pushed a commit to patiencelabs/Play20 that referenced this issue Mar 13, 2013
[playframework#826] fix for recursive method call for createStatement in AutoCleanCon...
@jroper
Copy link
Member

jroper commented Oct 15, 2013

We should revisit this now that we've decided to stick with F.Promise a little longer.

baloo pushed a commit to baloo/Play20 that referenced this issue Nov 7, 2013
jroper added a commit that referenced this issue Nov 8, 2013
[#826] Make Promise.{flat,}map allow supertypes
@jroper jroper closed this as completed Mar 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants