Skip to content

Disallow inferred splices and set the correct position #4780

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 1 commit into from
Jul 10, 2018

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki
Copy link
Contributor Author

Addressing comments in #4775

object Test {
def loop[T](x: Expr[T])(implicit t: Type[T]): Expr[T] = '{
val y: ~t = ~x
~loop( // error: inferred loop[~t] where T should be used
Copy link
Member

Choose a reason for hiding this comment

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

Instead of giving an error, couldn't the typechecker be smart enough to dealias?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The difficulty is that this depends on the quotation level and we do not have it at typer time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wouldn't worry to much about this case and encourage the use of T instead of ~t.

@biboudis
Copy link
Contributor

Looks good!

@smarter smarter merged commit cf2c202 into scala:master Jul 10, 2018
@Blaisorblade Blaisorblade deleted the fix-#4774 branch July 23, 2018 16:48
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.

3 participants