Skip to content

Fix #1765: Context bounds and denotation handling #1768

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 4 commits into from
Dec 10, 2016

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Dec 2, 2016

This is the first time a fuzzing test has revealed two unrelated errors. The first error had to do with the desugaring of context bounds for higher-kinded types. It was straightforward to diagnose and fix.

The other error was much harder to diagnose. Replacing denotations via installAfter did not what it claimed to do.

Fixes #1765

Review by @DarkDimius

We were pushing the limit of 64 phases before.
With the change to the representation of higher-kinded type definitions,
context bounds could be hidden in the body of a type lambda. Need to
compensate for that.
The previous post-condition failed if a Ycheck was introduced between
memoize and constructors.
Once the context-bounds desugaring of i1765.scala was fixed, another problem came up:
We hit an invalid denotation due to some interaction between mixin and memoize.

It turned out that `insertInsteadOf` did not do what its doc comment claimed: it did
not store a forwarding pointer `nextInRun` in the overwritten denotation. Once that
was fixed we also needed to fix a follow-on erorr that now we could have chains of
invalid denotations linked by `nextInRun`.
@odersky odersky merged commit 4daf543 into scala:master Dec 10, 2016
@allanrenucci allanrenucci deleted the fix-#1765 branch December 14, 2017 16:59
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.

crash on compilable code: Exception in thread "main" scala.MatchError: ContextBounds ...
1 participant