Skip to content
New issue

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

correctly type Expr.ofTupleFromSeq for arity > 22 #17261

Merged
merged 3 commits into from
Apr 17, 2023

Conversation

bishabosha
Copy link
Member

identified that for all Seq with arity <= 22, the result had the most precise type possible, for > 22 then it was only Tuple

fixes #17257

@bishabosha
Copy link
Member Author

Also seeing the same failure here: tests/neg-custom-args/fatal-warnings/i15503g.scala it was failing #16056 too. Does anyone know what it is?

@dwijnand
Copy link
Member

Looks like a semantic merge conflict on the Wunused merges? @szymon-rd wdyt?

@dwijnand
Copy link
Member

Ah yeah, #17263

@nicolasstucki
Copy link
Contributor

@bishabosha also take into account #17257 (comment)

@bishabosha
Copy link
Member Author

@nicolasstucki I added a test for Expr.ofTuple with 23 elems

@bishabosha bishabosha merged commit 6980b2e into scala:main Apr 17, 2023
@bishabosha bishabosha deleted the fix-oftuplefromseq branch April 17, 2023 17:56
@bishabosha
Copy link
Member Author

could this be backported for 3.3.1 ?

@Kordyjan Kordyjan added this to the 3.3.1 milestone Aug 2, 2023
private def tupleTypeFromSeq(seq: Seq[Expr[Any]])(using Quotes): quotes.reflect.TypeRepr =
import quotes.reflect.*
val consRef = Symbol.classSymbol("scala.*:").typeRef
seq.foldLeft(TypeRepr.of[EmptyTuple]) { (ts, expr) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

asExprOf fails for tuples larger than 22
6 participants