Skip to content

Conversation

@CJSmith-0141
Copy link
Contributor

Also adds a test to make sure that code outside the package can still compile with a total function.

Closes #4329

Thank you @armanbilge for the solve and @Grogs for the writeup.

@CJSmith-0141
Copy link
Contributor Author

Looks like making it package private doesn't work for 2.12. Maybe un deprecate instead?

@joroKr21
Copy link
Member

joroKr21 commented Apr 3, 2025

I think on 2.12 you can't use a total function in place of a partial function. So that test would have to be only for 2.13+

@CJSmith-0141 CJSmith-0141 changed the base branch from series/3.6.x to series/3.x April 3, 2025 14:58
@CJSmith-0141
Copy link
Contributor Author

Ok since this would be a source breaking change for Scala 2.12, I changed the base branch for this PR to be series/3.x.

I also moved the test to be 2.13+.

@joroKr21
Copy link
Member

joroKr21 commented Apr 3, 2025

The previous change was already source breaking because Scala 2.12 can't infer the parameter type of the function passed to an overloaded method like onError { case e => ... } will complain about unknown function parameter type.

Copy link
Member

@armanbilge armanbilge left a comment

Choose a reason for hiding this comment

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

thanks!

@djspiewak
Copy link
Member

@armanbilge Are we going to retarget this to 3.6?

Copy link
Member

@armanbilge armanbilge left a comment

Choose a reason for hiding this comment

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

Are we going to retarget this to 3.6?

Yes!

@armanbilge
Copy link
Member

superseded #4343

@armanbilge armanbilge closed this Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow IO.onError to be passed a total function

4 participants