These tests had Darwin-specific code in them, mostly unnecessary,
that caused them to break on non-Darwin platforms.
Only one (reflect_Enum_SingleCaseCFPayload.swift) was actually
specific to Darwin. That one has been disabled. For the rest,
just delete the unnecessary `import Darwin` and similar.
A "trivial" enum is one that carries no information.
The previous logic asserted that a trivial enum had only one
case and that case had no payload.
But this is also a trivial payload:
```
// Trivial, so zero-sized
enum MyFormatVersion {
case v4
}
// Also trivial, since the payload carries no information
enum Format {
case MyFormat(MyFormatVersion)
}
```
This commit adds a test case similar to the above
and corrects the assertions for trivial enums to
assert that there is either no payload, or that the
payload is zero-sized.
Resolves rdar://116406504
Disable the assert:
// At least one payload is non-empty (otherwise this // would get laid out as a non-payload enum) assert(getNumNonEmptyPayloadCases() > 0);
in TaggedMultiPayloadEnumTypeInfo because it fails when you have
generic but zero-sized payload enum cases.
Also remove unnecessary "REQUIRES: objc_interop" lines from the enum
reflection tests.
Before move-checking values, complete the lifetimes of all the values
derived from them via copy, borrow, and move.
Collect all such values and their derived transitive values and then
complete the lifetimes of each, visiting the instructions which produce
them in post-order.
Once OSSALifetimeCommpletion runs as part of SILGenCleanup, this code
can be deleted.
We already use a complexity limit for other functions in AliasAnalysis.
This is a workaround for quadratic complexity in ARCSequenceOpts.
Fixes a compile time problem
rdar://114352817
The metatype param may or may not be removed from the callee during
specialization. If it is, there is only one argument, if it is not,
there are two arguments. None of that is relevant to this test case.
It is just verifying that the strong_retain occurs before the apply.
`Dictionary.init(dictionaryLiteral:)` was annotated
`@_effects(readonly)` which means among other things that it doesn't
release any references. Being an init, however, it consumes its
arguments, and so does in fact release.
rdar://114699006
This was disabled due to:
```
Unable to decode the command from the command line:
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 13-20: surrogates not allowed
```
Note that this error isn't in `line-directive`, but in Python decoding
surrogates from the command line. Not sure why that's not allowed, but
printing from within a script works so change to that.
We already set `PYTHONIOENCODING=UTF8` in the environment in
`test/lit.cfg`, which makes sure stdout is UTF8 as opposed to ASCII.
Resolves rdar://92613094.
This test occasionally fails due apparently not loading libswiftFoundation. The test relies on a bridging header to import the Foundation module, which seems iffy. Explicitly import Foundation instead.
rdar://114590327
These builds do not work outside of darwin currently. Rather than adding
the skip to all the necessary build presets, just disable in the product
instead.
This library served its purpose and has overstayed its welcome.
The library shipped in Xcode can't change again from the state it was
in, so changes to the sources here will not affect that library, which
is confusing. The library does not currently build due to changes in the
runtime headers, so it does not give meaningful signal to anything
anymore. If you need to test things in a backdeploy concurrency
environment, use the copy from the toolchain in Xcode as that will give
you a far clearer picture of what the code will actually be running with
than the state of the sources here did.
In https://github.com/apple/swift/pull/66560 , a bug in the lowering of
`global_addr` was fixed. Part of that fix was to postpone mapping the
type of the global into context until getting the address of the global
and projecting the buffer for the out-of-line value; at that point, the
type is mapped into context and the address is cast.
It introduced an issue for fixed-size globals, however: the type of such
globals was not mapped into context; the result was that the lowered
value set for the corresponding SIL value would have the wrong type.
Fix that by extracting the code which mapped the type into context and
cast the address to the appropriate lowered type into a lambda and call
that lambda both in both the fixed-size (newly) and non-fixed-size (as
before) cases.
rdar://114013709
A type variable that represents a key path literal cannot be bound
directly to `AnyKeyPath` or `PartialKeyPath`, such types could only
be used for conversions.
It used to be the task of the binding inference to infer `AnyKeyPath`
and `PartiaKeyPath` as a `KeyPath` using previously generated type
variables for a root and value associated with key path literal
(previously stored in the locator).
Recently we switched over to storing key path information in the
constraint system and introduced `resolveKeyPath` method to gain
more control over how key path type variable gets assigned.
Getting information from the constraint system creates a problem
for the inference because "undo" for some bindings would be run
after solver scope has been erased, so instead of modifying bindings
in `inferFromRelational`, let's do that in `resolveKeyPath` right
before the key path type variable gets bound which seems to be a
better place for that logic anyway.
Resolves: rdar://113760727
This commit changes fixit messages from a question/suggestion to an
imperative message for protocol conformances and switch-case. Addresses
https://github.com/apple/swift/issues/67510.