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

Cannot resolve In from class zio.cache.Cache$$anon$1 #1577

Closed
jxnu-liguobin opened this issue Dec 31, 2023 · 3 comments
Closed

Cannot resolve In from class zio.cache.Cache$$anon$1 #1577

jxnu-liguobin opened this issue Dec 31, 2023 · 3 comments
Assignees
Labels
Milestone

Comments

@jxnu-liguobin
Copy link

jxnu-liguobin commented Dec 31, 2023

This is Scala, since the minimum reproduction code is uncertain at this point, a guess would be something like this:

abstract class Cache[-Key, +Value]:

  def get(key: Key): Value

object Cache:

  def make[In, Key, Value](keyBy: In => Key) = new Cache[In, Value]:
    override def get(in: In): Value = ???

The full code is here
https://github.com/zio/zio-cache/blob/series/2.x/zio-cache/shared/src/main/scala/zio/cache/Cache.scala

@jxnu-liguobin jxnu-liguobin changed the title Cannot resolve In from class zio.cache.Cache$$anon$1 Cannot resolve In from class zio.cache.Cache$$anon$1 Dec 31, 2023
@raphw
Copy link
Owner

raphw commented Feb 24, 2024

I would assume that there is an issue in the Scala compiler here. Did you try to resolve the type variables using Java reflection? It would normally result in the same error.

@raphw raphw self-assigned this Feb 24, 2024
@raphw raphw added the question label Feb 24, 2024
@raphw raphw added this to the 1.14.12 milestone Feb 24, 2024
@jxnu-liguobin
Copy link
Author

I would assume that there is an issue in the Scala compiler here. Did you try to resolve the type variables using Java reflection? It would normally result in the same error.

Are you referring to the get method for reflecting Cache instances? But what I got was the Object

@raphw
Copy link
Owner

raphw commented Feb 26, 2024

If you get hold of zio.cache.Cache$$anon$1 Class representstion, and call methods for getting generic types on it, I'd assume it yields similar exceptions.

@raphw raphw closed this as completed Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants