Skip to content

Fix #5986: Add autolift implicit conversion #6038

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

Merged
merged 3 commits into from
Apr 2, 2019

Conversation

biboudis
Copy link
Contributor

@biboudis biboudis commented Mar 7, 2019

Add an autolift implicit conversion and update tests.

Eliminating .toExpr doesn't give always good intuition about what kind of values exist inside a splice.
For example with autolift the following code has x in both cases. One of them is implicitly lifted and the other is not 😛.

def dyn[T: Liftable](pv: PV[T]): Expr[T] = pv match {
  case Sta(x) => x 
  case Dyn(x) => x
}

WDYT?

@biboudis biboudis self-assigned this Mar 7, 2019
@odersky
Copy link
Contributor

odersky commented Mar 7, 2019

I think that's fine since normally we do not care whether something is lifted or not.
I'd even go further and include the autolift conversion in quoted. If one does not want it, one can still write

import scala.quoted.{autolift => _, _}

@biboudis biboudis marked this pull request as ready for review March 12, 2019 13:07
@biboudis biboudis requested a review from nicolasstucki March 12, 2019 13:07
Copy link
Contributor

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

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

We need to add this to principled-meta-programming.md. Probably a new paragraph at the end of the The Liftable type-class section.

@nicolasstucki
Copy link
Contributor

Could you also change the commit message to Fix #5986: .... Github does not detect it on the PR title.

@biboudis
Copy link
Contributor Author

biboudis commented Mar 27, 2019

Rebased, updated the doc and left the automatic way out for now.

@nicolasstucki nicolasstucki merged commit 7ed9a69 into scala:master Apr 2, 2019
@nicolasstucki nicolasstucki deleted the autolift branch April 2, 2019 11:43
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.

5 participants