Commit Graph

3 Commits

Author SHA1 Message Date
Becca Royal-Gordon
94ec99c7f0 Avoid invalidating @_objcImplementation
In #69257, we modified `ObjCReason` to carry a pointer to the @implementation attribute for the `MemberOfObjCImplementationExtension` kind. This made it mark the @implementation attribute as invalid, suppressing diagnostics from the ObjCImplementationChecker.

However, invalidating the attribute *also* causes it to be skipped by serialization. That isn’t a problem if the diagnostics are errors, since we’ll never emit the serialized module, but #74135 softened these diagnostics to warnings for early adopters.

The upshot was that if Swift emitted one of these warnings when it compiled a library, clients of that library would see the objcImpl extension as a normal extension instead. This would cause various kinds of mischief: ambiguous name lookups because implementations weren’t being excluded, overrides failing because an implementation was `public` instead of `open`, asserts and crashes in SILGen and IRGen because stored properties were found in seemingly normal extensions, etc.

Fix this by setting a separate bit on ObjCImplementationAttr, rather than the invalid bit, and modifying the implementation checker to manually suppress many diagnostics when that bit is set.

Fixes rdar://134730183.
2024-09-05 17:55:12 -07:00
Alejandro Alonso
a9da08ccb6 Add option for raw layout to move as its like type 2024-05-28 14:34:22 -07:00
Saleem Abdulrasool
86de45a8e4 Sema: track and emit un-deserialized members
This adds tracking of the vtable holes due to a failure to deserialize
vtable entries.  This allows for the user to be able to identify what
member failed to be deserialied and can aid in understanding why an
`open` class may not be subclassed.

Future improvements here would allow tracing the XRefPath which failed
to be deserialied.  However, this still provides an improvement over the
existing experience where there is no available information on why the
class cannot be inherited from.
2022-01-24 21:03:32 -08:00