Skip to content

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 19, 2025

  1. Strip implied cap.rd sets from Capability types in extends and bounds

    I.e. We do not add an implicit cap.rd in

    class C extends Capability
    type T <: C

  2. Don't map CapSet^ to CapSet^{fresh}. Assume ^ is root in some comparisons with CapSet.

# Conflicts:
#	compiler/src/dotty/tools/dotc/cc/Setup.scala
@odersky odersky force-pushed the capability-bounds branch from ff6f4b8 to a94efa4 Compare March 19, 2025 17:33
Copy link
Contributor

@natsukagami natsukagami left a comment

Choose a reason for hiding this comment

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

Just some comment about new withCapAsRoot calls

case _ =>
if isCaptureVarComparison then
return subCaptures(tp1.captureSet, tp2.captureSet).isOK
return CCState.withCapAsRoot:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should leave a comment to make sure we don't introduce unsoundness


if isCaptureVarComparison then
return subCaptures(tp1.captureSet, tp2.captureSet).isOK
return CCState.withCapAsRoot:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should leave a comment to make sure we don't introduce unsoundness

case tree: New =>
case tree: TypeTree => checkAppliedTypesIn(tree.withType(tree.nuType))
case tree: TypeTree =>
CCState.withCapAsRoot:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should leave a comment to make sure we don't introduce unsoundness

@odersky odersky merged commit 5a5ddac into scala:main Apr 24, 2025
30 checks passed
@odersky odersky deleted the capability-bounds branch April 24, 2025 13:12
@WojciechMazur WojciechMazur added this to the 3.7.1 milestone May 1, 2025
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.

3 participants