Skip to content

Restrict Eta-reduction to Java-defined classes #8469

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 7 commits into from
Mar 9, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 8, 2020

Collapse [X] =>> C[X] only if C is a Java-defined class. Since
Java does not have hk-types it must be a raw type in this case.

odersky added 3 commits March 8, 2020 15:58
Collapse `[X] =>> C[X]` only if `C` is a Java-defined class. Since
Java does not have hk-types it must be a raw type in this case.
@smarter
Copy link
Member

smarter commented Mar 8, 2020

We try to always cook raw types so in what case is this actually needed ?

@odersky
Copy link
Contributor Author

odersky commented Mar 8, 2020

@smarter Failing tests if the case EtaExpansion clauses are completely removed:

    tests/pos/t3349 failed
    tests/pos/t3429 failed
    tests/pos-java-interop/t1196 failed

@smarter
Copy link
Member

smarter commented Mar 8, 2020

OK, so it seems the issues all come from joint-compilation with .java sources where we don't actually cook types.

@odersky
Copy link
Contributor Author

odersky commented Mar 8, 2020

OK, we cook types coming from Java sources now as well, which means we can simplify TypeComparer to no longer test for eta expansions.

@odersky
Copy link
Contributor Author

odersky commented Mar 8, 2020

Backing out. It seems we cannot cook things everywhere without running into cyclic references.

@odersky odersky merged commit 32b35ec into scala:master Mar 9, 2020
@odersky odersky deleted the fix-#4908 branch March 9, 2020 13:45
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