-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[WIP] Change references to private fields #3134
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Commit Messages
We want to keep history, but for that to actually be useful we have
some rules on how to format our commit messages (relevant xkcd).
Please stick to these guidelines for commit messages:
- Separate subject from body with a blank line
- When fixing an issue, start your commit message with
Fix #<ISSUE-NBR>:
- Limit the subject line to 72 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line ("Added" instead of "Add")
- Wrap the body at 80 characters
- Use the body to explain what and why vs. how
adapted from https://chris.beams.io/posts/git-commit
Have an awesome day! ☀️
AppliedType will be used for all type applications, higher-kinded or not. That is, eventually, it will replace HKApply and also the encodings of type applications as refined types. This commit introduces AppliedType and adapts baseType computations to take it into account. AppliedType is not yet constructed anywhere, however.
So far, everything up to parents is adapted to new scheme. Parents is half done; needs more work once we change layour of ClassInfo.
Simplifies usage and removes some obscure code in Types
Systematically introduce handlers for AppliedTypes where there was a handler for HKApply.
Also, change asSeenFrom to use it for arguments
Avoid printing addresses and reduce junk.
We had a stackoverfloa in asSeenFrom even under the old scheme, since there was a bad change involving checkRealizableBounds.
Otherwise we always need to a clean compile to update things.
The previous type parameter representation in terms of type members achieved bounds propagation by waiting until a type member was selected and then taking original bounds and refinements together as its info. This no longer works with explicit applications. Instead, we need to propagate bounds into wildcard arguments explicitly, when a type application is created. Also, fix argument computation in asSeenFrom
Need to avoid variance 0, as it leads to leaking ranges.
Strange as it sounds, a TypeBounds can be a subtype of a single type.
Needed to compile i0239.scala correctly.
- Several fixes for TypeArgRef. - argForParam needs to follow owner chains like toPrefix does (see t119.scala)
Needed to make i2250.scala compile
Can't rely any ore that refinements are stripped away in normalizeClassRef
Without the tweak, neg/i1181c.scala gives the non-sensical message `type mismatch: found: Foo[Int, Int], expected: Any`.
Make argForParam part of derivedSelect. This not only necessary for asSeenFrom but also for other transformatuons that change ThisTypes to something that can instantiate a type parameters. An example is the tree type map in the inliner. The change fixes i1891.scala.
It seemes with the new signature scheme we get NoPrefix Termrefs with NotASignature signatures that can still point to methods. Not a problem, except that it confused adaptRef in ParamForwarding.
Avoids a special case in loadDenot.
Move logic from subclasses into NamedType. Use explicit initialization instead of laziness.
Needed because we sometimes form NamedTypes with naked symbols.
Thsi will be cleaned up further in next commit.
withfixedSym -> apply It's just apply with a different designator apply(Type, Symbol) -> withSym This one contains special cases.
Make nonMemberTermRef redundant by marking local dummies and import symbols as Fresh (i.e. they are non-members).
Also - rename Fresh flag to NonMember - update criterion for phases where refs are symbolic. This used to be just before erasure (at resolveSuper) but then other phases were inserted after resolveSuper and the test became outdated. It's more robust now.
- drop withSym - rename withSymAndName to another apply - streamline select methods
To do this, we needed a more robust version of Symbol#signature.
Also, drop signature parameter in TermRef.withSigAndDenot
Also, drop signature parameter in TermRef.withSigAndDenot
The exception previously made for Scala2 innner classes causes the benchmark library project to fail with in the tree type map FullParameterization when called from LinkScala2Impl. It's not necessary to make the special case there because the Scalq2Unpickler will create anyway symbolic references to such inner classes.
The problem is that the assertion in checkNoLeaks might be wrong if the widened type is erroneous. This happened during editing.
e07f737
to
d835a38
Compare
Widthdrawn in favor of #3147 |
No description provided.