compiletime.summonAll should be able to create constraints. #23233
bishabosha
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dilemma: I have a trait
Foo[Q,R]
, and a tuple typeQs
. I need to use implicit search to summon a tuple ofTuple.Map[Qs, [Q] =>> Foo[Q, ?]
but also infer a tuple typeRs
corresponding to theR
of eachFoo[Q, ?]
.problem - If i use
compiletime.summonAll
then there is no way to infer the output Rs as far as i can tell..With traditional implicit search, this is easy:
i.e. given only a concrete tuple type
X := (Expr[Int], Expr[String])
i can summon from contextRows[(Expr[Int], Expr[String]), (Int, String)]
and so infer the typeY := (Int, String)
.I have not been able to find a way to do the same with just
compiletime.summonAll
which i think is meant to be more efficient, the recursive implicit search approach is quite slow if there are say 200 elements in the tuple.This recursive way is also necessary because match types can not handle large tuple sizes without blowing the stack - but this recursive implicit search can
Beta Was this translation helpful? Give feedback.
All reactions