-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support inline unapplySeq and with leading given parameters #16358
Conversation
5fc9776
to
4646e10
Compare
6cbb190
to
ee5283f
Compare
case TypeApply(_, targs) => targs | ||
case _ => Nil | ||
val unapplyInfo = sym.info match | ||
case info: PolyType => info.instantiate(targs.map(_.tpe)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why isn't this needed anymore? The comment above could maybe explain how type parameters are handled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's handled by fun.tpe.widen
(line 202)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment below and managed to simplify the leading implicits logic thanks to the use of fun.tpe.widen
.
Now it even works with something as complex as
extension [T] (using A)(inline ctx: Macro.StrCtx)(using B) inline def unapplySeq[U](using C)(inline input: T)(using D)(using F): Option[Seq[T]] = ???
* Fixes the computation of the inline unapply temporary unanimous unapply placeholder * Handle leading given parameters in inline unapplies Fixes scala#8577 Fixes scala#12991 Fixes scala#15188
ee5283f
to
3b1d780
Compare
Based on #15191 by @gorilskij and enables support for #12991.
Fixes #8577
Fixes #12991
Fixes #15188