Hello,
While reading the api page for scala.compiletime, I was surprised to find constValueTuple.
Which seems to exist as a consequence of tuples of constant types not being themselves constant types. ( for example constValue[(1,2)] fails with not a constant type )
As a consequence, since constValueTuple calls constValue on the tuple’s element, things like constValueTuple[( (1,2), (3,4) )] fail.
And more broadly, given a type that is either a constant type or a “constant tuple”, there is no simple way to constValue it.
There is also no equivalent to constValueOpt for tuples.
Hence my questions:
- Why are tuples of constant types not also constant types ?
- Should
constValuecheat, and work anyways on cases whereconstValueTuplesucceeds ? - Should
constValueOptcheat, and returnSomeon cases whereconstValueTuplesucceeds ? - Should
constValueTupleuse a special “union” ofconstValueandconstValueTuplefor the elements instead ?