Closed
Description
We should probably document that using
clauses with parameters annotated val
/var
generate a given
instance in their body (this is obvious for Scala 2 users, but maybe not for someone who has only ever seen the new syntax, where using
may have been understood as only a "consumer" of given
instances)
Minimized example
class GivenIntBox(using val givenInt: Int)
@main def test =
val b = GivenIntBox(using 23)
import b.given
println(summon[Int])
Output
23