Fix regression with eta expansion of implicit method#5983
Merged
adriaanm merged 2 commits intoscala:2.12.xfrom Sep 21, 2017
Merged
Fix regression with eta expansion of implicit method#5983adriaanm merged 2 commits intoscala:2.12.xfrom
adriaanm merged 2 commits intoscala:2.12.xfrom
Conversation
Member
Author
|
Review in good time by @adriaanm (if/when the new dependently-typed member allows it.) |
This was referenced Jul 21, 2017
lrytz
reviewed
Jul 21, 2017
test/files/neg/t10279.scala
Outdated
| // foo(1) _ | ||
| } | ||
|
|
||
| foo(1) _ |
Member
There was a problem hiding this comment.
let's add the slightly simpler test case from scala/bug#10299
scala> def foo(implicit x: Int): Int = x
scala> val bar = foo _
43d9c26 to
babc850
Compare
adriaanm
approved these changes
Sep 18, 2017
Contributor
adriaanm
left a comment
There was a problem hiding this comment.
LGTM. Added Lukas's test case
Member
|
In scala#5327, a change was made to typedEta to accept an original (ie, pre-typechecked) tree to be used in a fallback path. However, the caller provided an original tree larger than the actual tree being typechecked. This commit just passes the part of the orig tree that corresponds to the tree we're eta expanding, rather than the entire `Typed(methodValue, functionPt)` tree. That avoids an infinite loop in typechecking the erroneous code in the test case.
babc850 to
2596e32
Compare
Contributor
|
Push -f'ed to Jason's branch again :) |
lrytz
added a commit
to lrytz/scala
that referenced
this pull request
Dec 1, 2017
In scala#6092, `-Xsource:2.13` was enabled by default. Between this PRs parent and current 2.13.x, there were some changes that depended on this flag (scala#5983, scala#6069).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #5327, a change was made to typedEta to accept an
original (ie, pre-typechecked) tree to be used in a
fallback path.
However, the caller provided an original tree larger
than the actual tree being typechecked.
This commit just passes the part of the orig tree that
corresponds to the tree we're eta expanding, rather than
the entire
Typed(methodValue, functionPt)tree.That avoids an infinite loop in typechecking the erroneous
code in the test case.
Fixes scala/bug#10279