Skip to content

Commit ce10cc7

Browse files
committed
A dictionary must be native if *either* the key *or* the value is guaranteed not
to be a class/objc existential type.
1 parent b30f9fe commit ce10cc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/core/HashedCollections.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2915,7 +2915,7 @@ internal enum _Variant${Self}Storage<${TypeParametersDecl}> : _HashStorageType {
29152915

29162916
@_transparent
29172917
internal var guaranteedNative: Bool {
2918-
return _canBeClass(Key.self) == 0 && _canBeClass(Value.self) == 0
2918+
return _canBeClass(Key.self) == 0 || _canBeClass(Value.self) == 0
29192919
}
29202920

29212921
@warn_unused_result
@@ -3942,7 +3942,7 @@ public struct ${Self}Generator<${TypeParametersDecl}> : GeneratorType {
39423942
%if Self == 'Set':
39433943
return _canBeClass(Element.self) == 0
39443944
%elif Self == 'Dictionary':
3945-
return _canBeClass(Key.self) == 0 && _canBeClass(Value.self) == 0
3945+
return _canBeClass(Key.self) == 0 || _canBeClass(Value.self) == 0
39463946
%end
39473947
}
39483948

0 commit comments

Comments
 (0)