You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm expecting the above code to compile but it doesn't. If I (1) add dummy line that calls for this implicit value too, or (2) change the definition order, or (3) change implicit object to implicit lazy val then the code compiles fine
1.
I'm really surprized that (1) fixes this issue. Intuitively it should not affect implicit resolution of existing code at all.
Initially I've faced this issue on Scala 2.12.14 which has exactly the same behavior in this case. Also, if I compile this code in Scala 3 then it works fine. Maybe you will find it useful.
The text was updated successfully, but these errors were encountered:
myazinn
changed the title
implicit object is not available for implicit resolution if it's defined in another object
implicit object is not available for implicit resolution
Aug 5, 2021
reproduction steps
using Scala 2.13.6,
problem
I'm expecting the above code to compile but it doesn't. If I (1) add dummy line that calls for this implicit value too, or (2) change the definition order, or (3) change
implicit object
toimplicit lazy val
then the code compiles fine1.
I'm really surprized that (1) fixes this issue. Intuitively it should not affect implicit resolution of existing code at all.
Initially I've faced this issue on Scala 2.12.14 which has exactly the same behavior in this case. Also, if I compile this code in Scala 3 then it works fine. Maybe you will find it useful.
The text was updated successfully, but these errors were encountered: