When referring to an actor-isolated declaration from outside of the
actor, ensure that the types involved conform to the `ConcurrentValue`
protocol. Otherwise, produce a diagnostic stating that it is unsafe to
pass such types across actors.
Apply the same rule to local captures within concurrent code.
Now that the top-level source file is the only dependency source that
matters, the only case that matters is when request evaluation enters
a primary file. For non-primaries, there will be no corresponding
swiftdeps file to emit references into, so we're just wasting time and
memory keeping track of anything that happens there.
This is only possible after we removed cascading dependencies because
unqualified lookups had to be charged to the files they originated in.
Now, we charge those lookups to the primary that initiated the request.
Generalize `ClassDecl::getEmittedMembers()` to operate on an
`IterableDeclContext`, so that it can be for other nominal types,
extensions, etc. Rename to `getSemanticMembers()` to indicate that
these are all of the members that are semantically part of that
context.
Clean up the implementation slightly so it only forces type checking
for the conformances within that particular context (using
`getLocalConformances()`) and doesn't need to list out each of the
protocols it cares about.
* [Python3] Fix "undefined symbol 'unicode'" from python_lint
This is a little tricky.
Python 2 "unicode" was renamed to "str" in Python 3.
For Python 2 compatibility, we need to use "unicode" in a couple
of places, but that's not defined on Python 3, which causes
python_lint errors (even if the reference is never actually executed).
To workaround this, when running in Python 3, define "unicode"
as a synonym for "str". This defines the symbol (avoiding the
"undefined symbol" error from python lint) while preserving
the correct functionality on both Python 2 and Python 3.
When we drop Python 2 support (which we should do as soon as
possible), we can drop this workaround and globally replace
"unicode" with "str" to get the right Python 3-only functionality.
Adjust `gen-output-file-map.py` to be friendly to Python 3 by using
`io.open` instead of `open`. This allow the use of `encoding` and
`newline` named parameters to write out files using UTF-8 encoded, UNIX
newline delimited files.
-enable-experimental-private-intransitive-dependencies -> -enable-direct-intramodule-dependencies
-disable-experimental-private-intransitive-dependencies -> -disable-direct-intramodule-dependencies
While we're here, rename DependencyCollector::Mode's constants and clean
up the documentation.
In order for private dependencies to be completely correct, it must perform the name lookup unioning step when a cached request is replayed - not just when lookups are first performed. In order to reduce the overhead of this union operation, it is not necessary to walk the entire active request stack, just walk to the nearest cached request in the stack and union into that. When it is popped, its replay step will itself union into the next cached request.
To see why, consider a request graph:
A* -> B -> C*
|
-> D*
where A, C, and D are cached.
If a caller were to force C and D, then force A independenty, today we would *only* replay the names looked up by C and D the first time A was evaluated. That is, subsequent evaluations of A do not replay the correct set of names. If we were to perform the union step during replay as well, requests that force A would also see C and D’s lookups.
Without this, callers that force requests like the DeclChecker have to be wary of the way they force the interface type request so other files see the right name sets.
rdar://64008262
The old tests were just running the type checker because we used to only emit reference dependencies after Sema. Now that we emit them after the pipeline has run, let's upgrade these tests to capture these new references.
Add a mode bit to the dependency collector that respects the frontend flag in the previous commit.
Notably, we now write over the dependency files at the end of the compiler pipeline when this flag is on so that dependency from SILGen and IRGen are properly written to disk.
Move reference dependency tests out of NameLookup and into
Incremental/Dependencies. These tests will need to be specialized for
the upcoming private dependencies code.