-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix/#655 eta expansion #674
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
Factor out isValueSubClass into separate method. Will probably come in handly elsewhere, and makes the code easier to understand.
Failure to do a widen caused by-name parameters to go undetected.
@@ -601,6 +601,19 @@ object Types { | |||
ctx.typeComparer.isSameType(this, that) | |||
} | |||
|
|||
/** Is this type a primitive value type which can be widened to the primitive value type `to`? */ |
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.
typo to
-> that
lgtm |
In the test case, what was the too-narrow type that needed widening? Sharing that sort of detail makes review easier (and comes in handy when looking back at the history of this code.) |
I just traced this:
After looking at the surrounding code, I would suggest that this widening should be done by the caller to |
It was a TermRef. Stupid mistake, easy to make. On Fri, Jun 19, 2015 at 10:46 PM, Jason Zaugg notifications@github.com
Martin Odersky |
I see. In scalac we don't have to widen, because tree's have a |
@retronym I don't think there's a fixed convention whether we do widen in the caller or callee. The way it is in EtaExpansion is DRYer. If we move to caller, we have to duplicate the operation in the two callers to liftArgs. |
In that case, the paramaeter name of |
@retronym Good point. |
Review by @lrytz or @retronym. Based on #673, so only the second commit is new.