Skip to content

Conversation

@mtomko
Copy link
Contributor

@mtomko mtomko commented Dec 22, 2025

This is to address the potential confusion with java.lang.IO

I did experiment with a third option:

import java.lang.IO as _

object Test {

  def test: IO[Unit] = ???

}

but empirically, this didn't actually work - for some reason scalac insisted that the problem was not a missing type but rather than IO doesn't take type parameters (implying that it was referring to java.lang.IO rather than cats.effect.IO. I think that's odd but it's more likely that the right solution is just to import cats.effect.IO directly anyway.

This is to address the potential confusion with `java.lang.IO`
@durban
Copy link
Contributor

durban commented Dec 23, 2025

Another option is a proper -release < 25 (or -java-output-version on dotty) scalac option. Of course, that's not applicable if one needs something from JDK 25.

@mtomko
Copy link
Contributor Author

mtomko commented Dec 23, 2025

I'll note those options too. I don't know how long on the tooth we want to get for this potentially niche issue, though - presumably for the most part this will be useful only to beginners, as a seasoned Scala dev will recognize right away that the problem must be a conflicting definition.

@durban
Copy link
Contributor

durban commented Dec 23, 2025

Sure, I've just wanted to mention it.

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.

2 participants