-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Fix regression with eta expansion of implicit method #5983
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
Conversation
|
Review in good time by @adriaanm (if/when the new dependently-typed member allows it.) |
test/files/neg/t10279.scala
Outdated
| // foo(1) _ | ||
| } | ||
|
|
||
| foo(1) _ |
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.
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
left a comment
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.
LGTM. Added Lukas's test case
|
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
|
Push -f'ed to Jason's branch again :) |
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).
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