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

false error on .either #490

Open
strokyl opened this issue Nov 19, 2024 · 3 comments
Open

false error on .either #490

strokyl opened this issue Nov 19, 2024 · 3 comments

Comments

@strokyl
Copy link

strokyl commented Nov 19, 2024

I got the following code:

ZIO.serviceWithZIO[IndexedTopicService](_.list(aCluster.clusterSlug, apiCaller)).either

highlighted in red with the following error:

Replace with .map(Right(_)) 
Effect cannot fail; operation .either is impossible

To signature of the list method of IndexedTopicService:

  def list(
    clusterName: values.ClusterSlug,
    caller: core.domain.auth.ApiCaller
  ): IO[ConsoleError, List[IndexedTopic]]

Removing the ZIO plugin, remove the error.

ZIO plugin version: 2024.3.35.0
Intelij version: 2024.4.3
Scala: 3.5.2

The project is imported using BSP.

@hmemcpy
Copy link
Collaborator

hmemcpy commented Nov 19, 2024

Ugh, sorry about that. I'll take a look.

@hmemcpy
Copy link
Collaborator

hmemcpy commented Nov 19, 2024

Yeah, just as I expected. This is, unfortunately, a bug in the Scala plugin that made it into the release version. It breaks type signatures for partially-applied types. See this little squiggly?

image

This is IntelliJ resolving the signature of serviceWithZIO to the signature of its apply method instead, thinking it's missing some type arguments. This breaks the ZIO plugin because it now fails to correctly infer the environment.

Anyway, the team said they're working on a fix and it should be available soon, and hopefully this just "fixes" the ZIO plugin issue as well.

Keeping this issue open to verify when the fix becomes available.

@strokyl
Copy link
Author

strokyl commented Nov 26, 2024

Thank you for the information

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

No branches or pull requests

2 participants