Skip to content

Commit c9a9fa1

Browse files
committed
Introduce UnorderedComparingArray
1 parent 74b5e11 commit c9a9fa1

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Sources/SafeDICore/Models/TypeDescription.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ public enum TypeDescription: Codable, Hashable, Comparable, Sendable {
7373
case let .composition(types):
7474
return types
7575
.map { $0.asSource }
76-
// Sort the result to ensure stable code generation.
77-
.sorted()
7876
.joined(separator: " & ")
7977
case let .optional(type):
8078
return "\(type.asSource)?"

Tests/SafeDICoreTests/TypeDescriptionTests.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ final class TypeDescriptionTests: XCTestCase {
104104
XCTAssertFalse(typeDescription.isUnknown, "Type description is not of known type!")
105105
XCTAssertEqual(
106106
typeDescription.asSource,
107-
// Composition elements are sorted when creating source code in order to
108-
// ensure stable code generation, since composition ordering is arbitrary.
109-
"Bar & Foo"
107+
"Foo & Bar"
110108
)
111109
}
112110

0 commit comments

Comments
 (0)