Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit 2887964

Browse files
Fix test failures related to Optional: KeyPathIterable conformance (#1112)
* Apply fix from #1090
1 parent 5156d48 commit 2887964

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/x10/swift_bindings/apis/CrossReplicaSum.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extension _KeyPathIterableBase {
4949
let joinedkp = kp.appending(path: nkp)!
5050
if let valueType = type(of: joinedkp).valueType as? CrossReplicaSummable.Type {
5151
valueType._doCrossReplicaSum(&root, joinedkp, scale)
52-
} else if let nested = self[keyPath: nkp] as? _KeyPathIterableBase {
52+
} else if let value = self[keyPath: nkp], let nested = value as? _KeyPathIterableBase {
5353
nested.crossReplicaSumChild(&root, joinedkp, scale)
5454
}
5555
}

0 commit comments

Comments
 (0)