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
Is this the expected behavior? If so, is there any workaround on the user side? Or, is there any fix we may apply on the library side (other than migrating the whole codebase to Scala 3)?
Compiler version
Description
I found some weird behavior with Scala 3 while interoperating with a Scala 2 library, related to implicit conversions in the presence of subtyping.
This is the real code, using Natchez: https://scastie.scala-lang.org/BalmungSan/kGHAAsrsTWeFwMxryhoPeg/2
The code should compile because there is an implicit conversion from
String
toTraceValue
, but the compiler is not picking it.If I emulate the library using Scala 3: https://scastie.scala-lang.org/BalmungSan/kGHAAsrsTWeFwMxryhoPeg/15
Then, it works as expected (despite the conversion warning).
However, if I emulate the library using Scala 2: https://scastie.scala-lang.org/BalmungSan/kGHAAsrsTWeFwMxryhoPeg/16
Then, it fails again.
Is this the expected behavior? If so, is there any workaround on the user side? Or, is there any fix we may apply on the library side (other than migrating the whole codebase to Scala 3)?
Minimized code
Code
Output
The text was updated successfully, but these errors were encountered: