Skip to content

ProtoTypes#wildApprox: fix LazyRef approximation #1107

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 1 commit into from
Feb 19, 2016

Conversation

smarter
Copy link
Member

@smarter smarter commented Feb 18, 2016

Before this commit, the output of wildApprox(A) where A <: Sys[LazyRef(A)] was
? <: Sys[LazyRef(() => wildApprox(A))]. This lead to infinite
subtyping checks.

This is fixed by always approximating a LazyRef by an unbounded
wildcard. Since we only create LazyRefs when we encounter a cycle, this
should be safe.

Fix #1103.

Review by @odersky

Before this commit, the output of `wildApprox(A)` where `A <: Sys[LazyRef(A)]` was
`? <: Sys[LazyRef(() => wildApprox(A))]`. This lead to infinite
subtyping checks.

This is fixed by always approximating a LazyRef by an unbounded
wildcard. Since we only create LazyRefs when we encounter a cycle, this
should be safe.

Fix scala#1103.
odersky added a commit that referenced this pull request Feb 19, 2016
ProtoTypes#wildApprox: fix LazyRef approximation
@odersky odersky merged commit 46b7fc7 into scala:master Feb 19, 2016
@allanrenucci allanrenucci deleted the fix/wildApprox-lazyref branch December 14, 2017 19:23
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.

Infinite loop in subtyping when a default parameter has an F-bounded type
2 participants