Commit Graph

3 Commits

Author SHA1 Message Date
Anthony Latsis
e52618ee34 Gardening: Migrate test suite to GH issues: validation-test/IRGen 2022-09-19 22:52:07 +03:00
Nate Chandler
da5888fd3f [IRGen] Bail on opt when seeing non-ABI field.
When analyzing a struct's layout to determine whether it contains a
single non-empty field, bail upon encountering a field that is not ABI
accessible.

Previously, rather than bailing (though that was the intent), the field
was ignored.  The result was that struct's with a single non-empty field
and any number of ABI inaccessible fields would be treated as if they
only had a single non-empty field.  Trouble ensued.

rdar://79513293
2022-03-30 17:55:39 -07:00
Jordan Rose
520d6b9b91 Make NS_TYPED_ENUMS ObjectiveCBridgeable when they wrap an object (#15270)
This allows them to be used in generic arguments for NSArray et al.
We already do this for the ones that wrap bridged values (like
NSString/String), but failed to do it for objects that /weren't/
bridged to Swift values (class instances and protocol compositions),
or for Error-which-is-special.

In addition to this being a sensible thing to do, /not/ doing this led
to IRGen getting very confused (i.e. crashing) when we imported a
Objective-C protocol that actually used an NS_TYPED_ENUM in this way.

(We actually shouldn't be using Swift's IRGen logic to emit protocol
descriptors for imported protocols at all, because it's possible we
weren't able to import all the requirements. But that's a separate
issue.)

https://bugs.swift.org/browse/SR-6844
2018-03-15 16:17:38 -07:00