mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
TypeBase::usesNativeReferenceCounting() was doing a lot of work to find the class that a type refers to, then determine whether it would use the native reference-counting scheme. Its primary caller in IRGen would use an overly-conservative approximation to decide between the “Objective-C” and “unknown” cases, which resulted in uses of “unknown” reference counting for some obviously-ObjC cases (e.g., values of “NSObject”). Moreover, the approximation would try to call into the type checker (because it relied unnecessarily on the superclass *type* of a class declaration), causing an assertion. Fixes rdar://problem/42828798.
2.1 KiB
2.1 KiB