Skip to content

Fix #9958: Avoid eta contractions when printing #9979

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 3 commits into from
Oct 14, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Oct 10, 2020

Don't eta contract if the result type of a lambda is an applied
type that's treated specially.

Don't eta contract if the result type of a lambda is an applied
type that's treated specially.
@odersky odersky changed the title Avoid eta contractions when printing Fix #9958: Avoid eta contractions when printing Oct 10, 2020
@nicolasstucki
Copy link
Contributor

nicolasstucki commented Oct 11, 2020

Does this also fixes #9971?

@nicolasstucki nicolasstucki linked an issue Oct 11, 2020 that may be closed by this pull request
The unapply method of EtaExpansion was missing several necessary
conditions, which are now added:

 - parameters and arguments must have same length
 - bounds must conform
@odersky
Copy link
Contributor Author

odersky commented Oct 11, 2020

#9971 was a different, and deeper problem. It's now also fixed.

@odersky
Copy link
Contributor Author

odersky commented Oct 11, 2020

Fixes #9971

Copy link
Contributor

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

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

LGTM.

It looks like #9965 is starting to cause issues in many places.

onlyEmptyBounds
// Note: this pre-test helps efficiency. It is also necessary since in some cases
// tparams is empty. This can happen when we change the owners of inlined local
// classes in mapSymbols. See pos/reference/delegates.scala for an example.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@odersky does this match what you saw while debugging or are there other problematic cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I saw, yes.

Co-authored-by: Nicolas Stucki <nicolas.stucki@gmail.com>
@nicolasstucki nicolasstucki merged commit bdc8092 into scala:master Oct 14, 2020
@nicolasstucki nicolasstucki deleted the fix-#9958 branch October 14, 2020 11:54
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
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.

Type bounds are not shown in type errors Some type lambdas printed incorrectly
3 participants