Skip to content

Commit e00f11f

Browse files
committed
[squash][stdlib] Report Hashable violations with _assertionFailure
1 parent a6bfc9b commit e00f11f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stdlib/public/core/Set.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,11 +2196,14 @@ extension _NativeSet {
21962196
internal func ELEMENT_TYPE_OF_SET_VIOLATES_HASHABLE_REQUIREMENTS(
21972197
_ elementType: Any.Type
21982198
) -> Never {
2199-
fatalError("""
2199+
_assertionFailure(
2200+
"Fatal error",
2201+
"""
22002202
Duplicate elements of type '\(elementType)' were found in a Set.
22012203
This usually means that either the type violates Hashable's requirements, or
22022204
that members of such a set were mutated after insertion.
2203-
""")
2205+
""",
2206+
flags: _fatalErrorFlags())
22042207
}
22052208

22062209
extension _NativeSet {

0 commit comments

Comments
 (0)