Skip to content

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Apr 29, 2022

Three capture checking fixes

  1. Fix nonDependentResultApprox. The previous code would unneccessarily widen covariant occurrences to *.
  2. Add handling of cases like SingletonType <:< CapturingType.
  3. Propagate element additions in a AvoidMapped variable back to source

Also:

  • Fix universal check for inferred types (accidentally left out during rebase)
  • Allow references to local class parameters in capture sets

Fixes #15049
Fixes #15057 (duplicate of #15049)
Fixes #15058

@odersky odersky changed the title Fix dependent function typing in cc Three capture checking fixes May 1, 2022
odersky added 3 commits May 1, 2022 19:15
Checking against capturing the universal capability now works also for inferred types. Also fix breakage from previous rebase
Allow references to local class parameters in capture sets of public members. These would have been classified as escaping private references before.
 1. Fix nonDependentResultApprox. The previous code would unncessessarily widen covariant occurrences to `*`. 2. Add handling of cases like SingletonType <:< CapturingType. 3. Propagate element additions in a AvoidMapped variable back to source
@odersky odersky added the cc-experiment Intended to be merged with cc-experiment branch on origin label May 1, 2022
@odersky odersky requested a review from anatoliykmetyuk May 1, 2022 18:18
@odersky odersky assigned odersky and anatoliykmetyuk and unassigned odersky May 1, 2022
Avoid the unsoundness in the previously used technique
Copy link
Contributor

@olhotak olhotak left a comment

Choose a reason for hiding this comment

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

Additional comment: discussion #15059 seems related to this PR (in the sense that this PR fixes the universal check). If it's possible to quickly reach a decision there, an implementation of that decision could be additionally included as part of this PR.

Co-authored-by: Ondřej Lhoták <olhotak@uwaterloo.ca>
@olhotak olhotak merged commit 0859705 into scala:cc-experiment May 3, 2022
@olhotak olhotak deleted the fix-15049 branch May 3, 2022 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc-experiment Intended to be merged with cc-experiment branch on origin

3 participants