It’s unnecessary, shouldn’t be serialized into module interfaces, and Swift doesn’t know how to compute it for an ABI-only decl since it doesn’t have accessors or an initial value.
No tests because enforcement isn’t in yet.
I am doing this in preparation for adding the ability to represent in the SIL
type system that a function is global actor isolated. Since we have isolated
parameters in SIL, we do not need to represent parameter, nonisolated, or
nonisolated caller in the type system. So this should be sufficient for our
purposes.
I am adding this since I need to ensure that we mangle into thunks that convert
execution(caller) functions to `global actor` functions what the global actor
is. Otherwise, we cannot tell the difference in between such a thunk and a thunk
that converts execution(caller) to execution(concurrent).
As the old comment indicates, it was not expected that build systems
would register binary swift modules produced from textual interfaces
with -add_ast_path, but we have found examples of the in the wild and
it leads to the most unexpected side effects. Fixing this is
straightforward, we can just check if a binary module was compiled
from a textual interface and then not bypass resilience.
rdar://145226754
The module name changes the symbol mangling, and also causes
TBDGen to emit linker directives. To separate out these two
behaviors, introduce a terrible hack. If the module name
contains a semicolon (`;`), the part before the semicolon
is the module name for mangling, and the part after the
semicolon is the module name for linker directives.
If there is no semicolon, both module names are identical,
and the behavior is the same as before.
An "abstract" ProtocolConformanceRef is a conformance of a type
parameter or archetype to a given protocol. Previously, we would only
store the protocol requirement itself---but not track the actual
conforming type, requiring clients of ProtocolConformanceRef to keep
track of this information separately.
Record the conforming type as part of an abstract ProtocolConformanceRef,
so that clients will be able to recover it later. This is handled by a uniqued
AbstractConformance structure, so that ProtocolConformanceRef itself stays one
pointer.
There remain a small number of places where we create an abstract
ProtocolConformanceRef with a null type. We'll want to chip away at
those and establish some stronger invariants on the abstract conformance
in the future.
* [CS] Decline to handle InlineArray in shrink
Previously we would try the contextual type `(<int>, <element>)`,
which is wrong. Given we want to eliminate shrink, let's just bail.
* [Sema] Sink `ValueMatchVisitor` into `applyUnboundGenericArguments`
Make sure it's called for sugar code paths too. Also let's just always
run it since it should be a pretty cheap check.
* [Sema] Diagnose passing integer to non-integer type parameter
This was previously missed, though would have been diagnosed later
as a requirement failure.
* [Parse] Split up `canParseType`
While here, address the FIXME in `canParseTypeSimpleOrComposition`
and only check to see if we can parse a type-simple, including
`each`, `some`, and `any` for better recovery.
* Introduce type sugar for InlineArray
Parse e.g `[3 x Int]` as type sugar for InlineArray. Gated behind
an experimental feature flag for now.
When performing lazy module serialization, we may be making the first attempt
to turn an `AvailableAttr` into a `SemanticAvailableAttr`. If it turns out the
attribute is invalid at that point, we need to skip it instead of assuming
that the attribute will always be valid there.
Resolves rdar://147539902.
Recover from a raw type hidden behind an internal or implementation-only
import by dropping the whole enum when the raw type is unavailable. This
scenario should happen only when looking at non-public decl for indexing or
debugging, or if dependencies somehow changed and left behind a stale
swiftmodule file.
rdar://147091863
Rename the macro UNWRAP to SET_OR_RETURN_ERROR for clarity and invert its
parameters to have a more intuitive order of assignment target and then
expression.
With '-sdk-module-cache-path', Swift textual interfaces found in the SDK will be built into a separate SDK-specific module cache.
Clang modules are not yet affected by this change, pending addition of the required API.
The Protocol field isn't really necessary, because the conformance
stores the protocol. But we do need the substituted subject type
of the requirement, just temporarily, until an abstract conformance
stores its own subject type too.
When a Swift function shadows a clang function of the same name, the
assumption was that Swift code would refer only to the Swift one.
However, if the Swift function is `@usableFromInline internal` it can be
called only from the local module and inlined automatically in other
clients. Outside of that module, sources see only the clang function, so
their inlinable code calls only the clang function and ignores the Swift
one. This configuration passed type checking but it could crash the
compiler at inlining the call as the compiler couldn't see the clang
function.
Let's update the deserialization logic to support inlined calls to the
shadowed or the shadower. Typical shadowing is already handled by the
custom deserialization cross-reference filtering logic which looks for
the defining module, scope and whether it's a Swift or clang decl. We
can disable the lookup shadowing logic and rely only on the
deserialization filtering.
rdar://146320871
https://github.com/swiftlang/swift/issues/79801
When code in the current module defaults to main actor (under SE-0466),
also infer main-actor isolation for protocol conformances of main-actor
isolated types.
Instead of using the `isolated P` syntax, switch to specifying the
global actor type directly, e.g.,
class MyClass: @MainActor MyProto { ... }
No functionality change at this point
We’re running out of bits in DeclAttrOptions, so split it in two: DeclAttrRequirements contains all the `On*` options that describe the declarations allowed to have the attribute, while the other options are now DeclAttrBehaviors.
This commit also sorts the entries in DeclAttr.def by serialization code and improves the formatting of the file.
In extended recovery mode we should recover from all errors without
crashing. Protect loadAllConformances and drop all conformance errors in
this mode.
rdar://81811394
For build systems that already generate these files, it makes sense to include the aliases so that the map file serves as a comprehensive index of how the module inputs are referenced.
We introduce a new macro called #SwiftSettings that can be used in conjunction
with a new stdlib type called SwiftSetting to control the default isolation at
the file level. It overrides the current default isolation whether it is the
current nonisolated state or main actor (when -enable-experimental-feature
UnspecifiedMeansMainActorIsolated is set).