-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use Scala 2 library TASTy in compilation tests #18590
Closed
nicolasstucki
wants to merge
117
commits into
scala:main
from
dotty-staging:use-scala2-library-tasty-in-tests
Closed
Use Scala 2 library TASTy in compilation tests #18590
nicolasstucki
wants to merge
117
commits into
scala:main
from
dotty-staging:use-scala2-library-tasty-in-tests
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nicolasstucki
force-pushed
the
use-scala2-library-tasty-in-tests
branch
2 times, most recently
from
September 29, 2023 13:04
cb69307
to
fe7a520
Compare
nicolasstucki
force-pushed
the
use-scala2-library-tasty-in-tests
branch
from
October 13, 2023 10:07
fe7a520
to
5fa3409
Compare
This is needed if we want to do setup transforms as part of denotation transformers.
1. Update symbols owner before recursing to children, so that new owners taking account of try block owners are installed. 2. Query owner chaines at phase checkCpatures when computing enclosing level owners.
I tried several other strategies, but nothing worked. - update after Setup: This means we cannot to levelOwner during setup. - running levelOwner after Setup causes CyclicErrors when transforming symbols in Setup - having a seperate notion of ccOwner maintained in a CCState table does not work since there are too many hidden uses of owner everywhere that would ignore that table.
(except if they are updated). This is the first step towards converting to capturing types in SymTransformer, where we have the context.
Need to copy the denotation, since denotations come with next pointers which would get scrambled otherwise.
Makes things more regular and allows for a non-identity mapping between declared types and infos of vals.
The new check is that a publicly visible inferred type after capture checking must conform to the type before capture checking (which is also the type seen by other separately compiled units).
Widen singleton types when instantiating local roots in checkConforms
Don't force info when checking whether something is a root capability while printing
Refactor everything so that now vals as well as defs can be level owners
Innstead of traversing old types at postCheck, note what needs to be done when these types are first transformed at Setup.
With the new way to construct capturing types at Setup, we can add the correct boxing annotations there, so the previous unmodular hack can be dropped.
Break out operation to add a single element. This makes widenCaptures redundant.
Avoid the mutable state in CapturSet.Var
In Scala 2 a setter was created at Typer for private, non-local vars. Variance checking then worked on the setter. But in Scala 3, the setter is only created later, which caused a loophole for variance checking. This PR does actually better than Scala 2 in the following sense: A private variable counts as an invariant occurrence only if it is assigned with a selector different from `this`. Or conversely, a variable containing a covariant type parameter in its type can be read from different objects, but all assignments must be via this. The motivation is that such variables effectively behave like vals for the purposes of variance checking.
We need to mark such assigns in the phase before PostTyper since they can appear in companion objects that come after the variable declaration.
…I less restrictive
This was printing the extra debug information when testing tests/neg-deep-subtype/i1650.scala
Co-authored-by: Matt Bovel <[email protected]>
The `Attributes` section contains a list of UTF-8 string that represent the attributes.
Also introduce `Scala2Tasty` flag to differentiate between Scala 2 symbols that come from class files and Scala 2 symbols that come from TASTy. At this point, the only Scala 2 TASTy is the one from the standard library. To know that a TASTy contains the definitions of the standard library, we add the `Scala2StandardLibrary` attribute to the TASTy file. We mark all unpickled classes from those TASTy files with `Scala2x | Scala2Tasty`.
The order of `Some` and `None` seem to have reversed. Not sure why and if we should care about it. The following seems to be a valid error but with the wrong error message: ``` -- Error: tests/patmat/t4408.scala:3:16 ---------------------------------------- 3 | case Nil => Unit | ^^^^ |Reference to object Unit in package scala should not have survived, |it should have been processed and eliminated during expansion of an enclosing macro or term erasure. ```
* With the tasty library we are not tagging these methods with the Case flag * The case accessors are listed as vals and not methods
nicolasstucki
force-pushed
the
use-scala2-library-tasty-in-tests
branch
from
October 19, 2023 14:31
7b55dc2
to
8d7a901
Compare
Replaced with #18875 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
FIXME
$extension
methods (fix: Scala2x flag + tasty attributes)dotty.tools.dotc.transform.PatmatExhaustivityTest
(update checkfiles)dotty.tools.dotc.coverage.CoverageTests