ncreep
ncreep

Reputation: 497

Destructing `given` assignment

In Scala 2 we can do a destructuring implicit assignment, like so:

implicit val (a, b, c) = (1, "foo", true)

Which defines implicit values for each tuple component.

What would be the equivalent using Scala 3's given syntax?

The following compiles:

given (Int, String, Boolean) = (1, "foo", true)

But defines a given tuple, not individual values.

Other than writing out the individual given clauses, is there something similar to implicit val?

Thanks

Upvotes: 0

Views: 22

Answers (0)

Related Questions