Skip to content

Commit 64d43f9

Browse files
committed
[NCGenerics] handle ReferenceStorageType queries
1 parent eee7207 commit 64d43f9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/AST/Type.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ static CanType preprocessTypeForInvertibleQuery(GenericEnvironment *env,
182182
Type orig) {
183183
Type type = orig;
184184

185+
// Strip off any StorageType wrapper.
186+
type = type->getReferenceStorageReferent();
187+
185188
// Always strip off SILMoveOnlyWrapper.
186189
if (auto wrapper = type->getAs<SILMoveOnlyWrappedType>())
187190
type = wrapper->getInnerType();

test/ModuleInterface/Inputs/Swiftskell.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,8 @@ public func isJust<A: ~Copyable>(_ m: borrowing Maybe<A>) -> Bool {
109109
public func isNothing<A: ~Copyable>(_ m: borrowing Maybe<A>) -> Bool {
110110
return !isJust(m)
111111
}
112+
113+
public struct UnownedRef<Instance: AnyObject> {
114+
@usableFromInline
115+
internal unowned(unsafe) var _value: Instance
116+
}

0 commit comments

Comments
 (0)