We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Demo Repository
The following code produces a different outcome when using Scala 3:
import com.softwaremill.macwire.wire case class Berry(var name: String) case class Basket(berry: Berry) object Main extends App { val blackberry: Berry = Berry("blackberry") val basket: Basket = { lazy val raspberry: Berry = Berry("raspberry") wire[Basket] } println(basket.berry.name) // scala 2.13.30 raspberry, scala 3.0.2 blackberry }
The text was updated successfully, but these errors were encountered:
@mbore maybe you have an idea if this is possible to fix?
Sorry, something went wrong.
If understood macwire as scala implicit(get by Context in this position). It's better to throw a compile time Exception.
macwire
implicit
Context
The problem here -in Scala 3- is not that blackberry is chosen over raspberry, but that raspberry is not considered at all!
blackberry
raspberry
If blackberry is removed, the code will fail to compile in Scala 3:
object Main extends App { val basket: Basket = { lazy val raspberry: Berry = Berry("raspberry") wire[Basket] // ERROR: Cannot find a value of type: [Berry] } println(basket.berry.name) }
No branches or pull requests
Demo Repository
The following code produces a different outcome when using Scala 3:
The text was updated successfully, but these errors were encountered: