Skip to content

Commit 4f886eb

Browse files
authored
Enable the MirrorBypass logic in Swift 6 (#631)
1 parent dd5a92d commit 4f886eb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Sources/FluentKit/Model/MirrorBypass.swift

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if compiler(<6)
1+
#if compiler(<6.1)
22
@_silgen_name("swift_reflectionMirror_normalizedType")
33
internal func _getNormalizedType<T>(_: T, type: Any.Type) -> Any.Type
44

@@ -24,7 +24,7 @@ internal struct _FastChildIterator: IteratorProtocol {
2424
deinit { self.freeFunc(self.ptr) }
2525
}
2626

27-
#if compiler(<6)
27+
#if compiler(<6.1)
2828
private let subject: AnyObject
2929
private let type: Any.Type
3030
private let childCount: Int
@@ -34,7 +34,7 @@ internal struct _FastChildIterator: IteratorProtocol {
3434
#endif
3535
private var lastNameBox: _CStringBox?
3636

37-
#if compiler(<6)
37+
#if compiler(<6.1)
3838
fileprivate init(subject: AnyObject, type: Any.Type, childCount: Int) {
3939
self.subject = subject
4040
self.type = type
@@ -48,7 +48,7 @@ internal struct _FastChildIterator: IteratorProtocol {
4848
#endif
4949

5050
init(subject: AnyObject) {
51-
#if compiler(<6)
51+
#if compiler(<6.1)
5252
let type = _getNormalizedType(subject, type: Swift.type(of: subject))
5353
self.init(
5454
subject: subject,
@@ -69,7 +69,7 @@ internal struct _FastChildIterator: IteratorProtocol {
6969
/// > Note: Ironically, in the fallback case that uses `Mirror` directly, preserving this semantic actually imposes
7070
/// > an _additional_ performance penalty.
7171
mutating func next() -> (name: UnsafePointer<CChar>?, child: Any)? {
72-
#if compiler(<6)
72+
#if compiler(<6.1)
7373
guard self.index < self.childCount else {
7474
self.lastNameBox = nil // ensure any lingering name gets freed
7575
return nil
@@ -105,7 +105,7 @@ internal struct _FastChildIterator: IteratorProtocol {
105105
}
106106

107107
internal struct _FastChildSequence: Sequence {
108-
#if compiler(<6)
108+
#if compiler(<6.1)
109109
private let subject: AnyObject
110110
private let type: Any.Type
111111
private let childCount: Int
@@ -114,7 +114,7 @@ internal struct _FastChildSequence: Sequence {
114114
#endif
115115

116116
init(subject: AnyObject) {
117-
#if compiler(<6)
117+
#if compiler(<6.1)
118118
self.subject = subject
119119
self.type = _getNormalizedType(subject, type: Swift.type(of: subject))
120120
self.childCount = _getChildCount(subject, type: self.type)
@@ -124,7 +124,7 @@ internal struct _FastChildSequence: Sequence {
124124
}
125125

126126
func makeIterator() -> _FastChildIterator {
127-
#if compiler(<6)
127+
#if compiler(<6.1)
128128
_FastChildIterator(subject: self.subject, type: self.type, childCount: self.childCount)
129129
#else
130130
_FastChildIterator(iterator: self.children.makeIterator())

0 commit comments

Comments
 (0)