Skip to content

Fix #2971: Soudness issue with variance and higher kinded types #2975

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 2 commits into from
Aug 16, 2017

Conversation

smarter
Copy link
Member

@smarter smarter commented Aug 14, 2017

We shouldn't use HKApply#superType in isRef, because this means
taking the upper bound of abstract type constructors.

@smarter smarter requested a review from odersky August 14, 2017 18:25
We shouldn't use `HKApply#superType` in `isRef`, because this means
taking the upper bound of abstract type constructors.
@smarter
Copy link
Member Author

smarter commented Aug 14, 2017

There's one test failure which is extremely annoying because it only happens when compiling all of the neg tests, even though the failure is in tests/neg/i1650.scala:

> vulpix tests/neg
# fails (but not everytime)
> vulpix tests/neg/i1650.scala
# succeeds

Here's the stacktrace extracted from the log:
https://gist.github.com/smarter/79becb6da8f91254e5b92de42e24cff3

Any idea what's going on?

Calling HKTypeLambda#member will crash when trying to form a NamedType,
this happened in `compareRefinedSlow` so we now skip it. If this
HKTypeLambda is an eta-expansion it will be handled by `fourthTry`.

Somehow, this only started happening after the last commit, when
running:
> vulpix tests/neg
But it's not deterministic, multiple runs may be necessary.
The crash happened while compiling i1650.scala, but compiling this file
by itself didn't trigger the failure.
@smarter
Copy link
Member Author

smarter commented Aug 14, 2017

Pushed a fix, though it's a bit kludgy to add special cases like that.

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

I think both fixes are fine. It would be nice to know what's going on, but since the failure is non-deterministic this could be difficult.

@smarter smarter merged commit 2c1e646 into scala:master Aug 16, 2017
@allanrenucci allanrenucci deleted the fix-hk-isRef branch December 14, 2017 19:20
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