Skip to content

Handle case where typevar instance is fully determined #2435

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
May 16, 2017

Conversation

odersky
Copy link
Contributor

@odersky odersky commented May 15, 2017

It's possible that a type parameter in a constraint gets instantiated via
a unification operation. In that case, the type parameter does not have
a TypeBounds instance associated with it, so is not considered to be
contained in the constraint. But it must still be possible to instantiate
a type variable corresponding to this parameter.

Test case in collection strawman: List.empty ++ List.empty.

@odersky odersky requested a review from biboudis May 15, 2017 18:02
Copy link
Contributor

@biboudis biboudis left a comment

Choose a reason for hiding this comment

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

The minimized example works as well :-)

Copy link
Contributor

@biboudis biboudis left a comment

Choose a reason for hiding this comment

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

LGTM

Need another check whether a constraint contains a typevariable
before going ahead with instantiating it.

Test case in collection strawman: `List.empty ++ List.empty`.
@odersky odersky force-pushed the fix-strawman-compile-4 branch from 7e3f5ab to 30fa29a Compare May 15, 2017 20:07
@felixmulder
Copy link
Contributor

@biboudis - add minimized test then merge :)

@felixmulder felixmulder merged commit 9aeb139 into scala:master May 16, 2017
@allanrenucci allanrenucci deleted the fix-strawman-compile-4 branch December 14, 2017 19:21
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.

4 participants