-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Backport "Separation checking for product types" to 3.7.0 #22964
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
Conversation
When printing a type `C^` where `C` extends `Capability`, don't show the `^`. This is overridden under -Yprint-debug. [Cherry-picked 103ef96]
- Add Mutable trait and mut modifier. - Add dedicated tests `isMutableVar` and `isMutableVarOrAccessor` so that update methods can share the same flag `Mutable` with mutable vars. - Disallow update methods overriding normal methods - Disallow update methods which are not members of classes extending Mutable - Add design document from papers repo to docs/internals - Add readOnly capabilities - Implement raeadOnly access - Check that update methods are only called on references with exclusive capture sets. - Use cap.rd as default capture set of Capability subtypes - Make Mutable a Capability, this means Mutable class references get {cap.rd} as default capture set. - Use {cap} as captu [Cherry-picked 748f4a6]
….toCap If existentials are mapped to fresh, it matters where they are opened. Pure or not arguments don't have anything to do with that. [Cherry-picked e4cc265]
These are represented as Fresh.Cap(hidden) where hidden is the set of capabilities subsumed by a fresh. The underlying representation is as an annotated type `T @annotation.internal.freshCapability`. Require -source `3.7` for caps to be converted to Fresh.Cap Also: - Refacture and document CaputureSet - Make SimpleIdentitySets showable - Refactor VarState - Drop Frozen enum - Make VarState subclasses inner classes of companion object - Rename them - Give implicit parameter VarState of subCapture method a default value - Fix printing of capturesets containing cap and some other capability - Revise handing of @uncheckedAnnotation [Cherry-picked ad11819][modified]
Check separation from source 3.7 on. We currently only check applications, other areas of separation checking are still to be implemented. [Cherry-picked 4c8a50f]
Check that a capability that gets hidden in the (result-)type of some definition is not used afterwards in the same or a nested scope. [Cherry-picked b0c9b3d]
[Cherry-picked 70074c4]
When checking whether two items overlap we should always check their deep capture sets. Buried aliases should count as well. [Cherry-picked 190aaca]
This is necessary since capability sets are IdentitySets. [Cherry-picked 67d42bd]
[Cherry-picked 131f070]
[Cherry-picked ee23239]
[Cherry-picked a4df033]
Downgrade to -source 3.6 to turn it off. [Cherry-picked 52dc9b4]
[Cherry-picked 824dd83]
Also: Fixes to computations of overlapWith and -- on Refs that take account of pathss, where shorter paths cover deeper ones. [Cherry-picked 821e17a]
[Cherry-picked 3ed82a3]
[Cherry-picked 2d37938]
[Cherry-picked d661678]
[Cherry-picked 9710872]
[Cherry-picked 51050f9]
[Cherry-picked 8d15e88]
[Cherry-picked 5132d55]
[Cherry-picked 21a5399]
[Cherry-picked 91eef32]
[Cherry-picked f3ef42b]
Not allowing whitespace clashes with the rules for leading infix operators. For instance, the following does not work, since `->` is not recognized as a leading infix operator. ```scala A ->{x} B ``` Also: Print existential capture set id under -uniqids [Cherry-picked 4c53fd1]
[Cherry-picked 641dffa]
Also, implement infrastructure to add a note to a type mismatch when a failure to subsume occurs. [Cherry-picked 58baf53]
Allows some simplifications in the zoo of classification methods. [Cherry-picked 33ef293]
Allows some simplifications in the zoo of classification methods. [Cherry-picked 12047d8]
[Cherry-picked 399b220]
[Cherry-picked 6093dab]
[Cherry-picked f7484ce]
Exceptions are bracketed in `withCapAsRoot` calls. [Cherry-picked d27f2bb]
TODO: Check that the new error in box-adapt-contra makes sense TODO: error messages need to be improved [Cherry-picked ec8d119]
[Cherry-picked 731c9aa]
1. Strip readonly modifier before checking o=for overlaps 2. Don't reset consume to empty before entering defs [Cherry-picked d89138a]
I believe the timeout was simply that we have to many pos tests, so theior compilation takes more than the limit of 20 minutes. Testing this hypothesis by moving pos-custumargs/captures tests into a separate top-level test posCC [Cherry-picked a6f1ab2]
Deduct explicit refs of actual as opposed to formal argument type. [Cherry-picked d2e276c]
- Make it peak-based instead of footprint-based - Don't flag rd/rd conflicts between consumed and re-used [Cherry-picked ee60b21]
[Cherry-picked c790007]
[Cherry-picked 9a49c52]
[Cherry-picked d781b3e]
Avoid globally visible vars in CCState. Make sure notes don't leak from one test to another. [Cherry-picked dc0dd7f]
[Cherry-picked fbe37b8]
[Cherry-picked ac84d13]
Intersections used the heuristic mightAccountFor instead of the precise accountsFor. Thsi can lead to a loss of precision and (if unchecked afterwards) also soundness. The fix caused some tests to fail, which involved tracked parameters. We now deal with tracked parameters in the same way as parameters that carry a @refineOverride annotation. [Cherry-picked 23cb1f3]
[Cherry-picked 48a52a2]
This backport was required by multiple conflicts occurring while backporting relatively small #22849 However, based on the size of changes (in this and 2 other PR) we'd prefer to not backport it at the last moment
@natsukagami @odersky Do you think it would be possible to create an alternative variant for 3.7.0 including only required stabilisation changes without a large refactor? Preferably only having required changes from #22849 and #22956 |
I'll extract the two PRs by tonight. EDIT see #22967 |
Backports #22539 to the 3.7.0-RC2.
PR submitted by the release tooling.