You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[cxx-interop] Avoid spurious references to _OBJC_CLASS symbols for C++ foreign reference types
This removes erroneous references to `_OBJC_CLASS_$__xyz` symbols that Swift was emitting for certain usages of C/C++ foreign reference types. This was discovered when trying to iterate over a Swift array of foreign reference types using a Swift for-in loop.
`Builtin.canBeClass` was returning true for foreign reference types, which led to the optimizer specializing the generic `canBeClass<T>` function to unconditionally return true for foreign reference types. This meant that `_isClassOrObjCExistential` for a foreign reference type evaluated to true, which made the Swift stdlib take the code path that was intended for Objective-C classes in `ArrayBuffer.getElement`, which assumed that the `Element` type conforms to `AnyObject`. Foreign reference types do not actually conform to `AnyObject`.
rdar://161814644
0 commit comments