Skip to content

Fix #6142: remove unreasonable type change for _ #6897

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 24, 2019

Conversation

liufengyun
Copy link
Contributor

@liufengyun liufengyun commented Jul 19, 2019

The logic was introduced in f618e47, which is hard to justify.
The problem is exhibited in tests/pos/i6142.scala, where
we have code lik the following:

    implicit val _: scala.quoted.Type = ...
    {
      def $anon$ = _
      closure($anon$)
    }

Changing the type of _ will break LambdLift (_ is not free anymore),
and the compiler crashes at backend when generating code for the unfound local variable _,
whose symbol is scala.quoted.Type.

The logic was introduced in f618e47, which is hard to justify.
The problem is exhibited in tests/pos/i6142.scala, where
we have code lik the following:

    implicit val _: scala.quoted.Type = ...
    {
      def $anon$ = _
      closure($anon$)
    }

Changing the type of `_` will break LambdLift (`_` is not free anymore),
and the compiler crashes at backend when generating code for the unfound local variable `_`,
whose symbol is `scala.quoted.Type`.
@liufengyun liufengyun requested a review from odersky July 19, 2019 21:03
@nicolasstucki nicolasstucki merged commit 6f59aa9 into scala:master Jul 24, 2019
@nicolasstucki nicolasstucki deleted the fix-6142 branch July 24, 2019 04:54
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.

2 participants