Commit Graph

2 Commits

Author SHA1 Message Date
Slava Pestov
c1d4589fb7 SIL: Fix type lowering of 'unowned T' where 'T' is a type parameter
The abstraction pattern's generic signature does not describe
the substituted type, and it may not be present at all.

Fixes https://github.com/swiftlang/swift/issues/79244.
2025-02-11 14:25:35 -05:00
Slava Pestov
8f38532018 SIL: Fix type lowering of unowned reference to class-bound generic parameter
Unowned references lower as address-only or loadable, depending on
whether the underlying class type is known to be native Swift or
not.

In the case where we were lowering an interface type, we would
unconditionally erase the type to AnyObject, producing an incorrect
lowering when the generic signature constrained the type parameter
to a native Swift class.

Fixes <rdar://problem/73083179>.
2021-01-12 18:58:01 -05:00