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

Fix test failures related to Optional: KeyPathIterable conformance #1112

Merged
merged 3 commits into from
Oct 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/x10/swift_bindings/apis/CrossReplicaSum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extension _KeyPathIterableBase {
let joinedkp = kp.appending(path: nkp)!
if let valueType = type(of: joinedkp).valueType as? CrossReplicaSummable.Type {
valueType._doCrossReplicaSum(&root, joinedkp, scale)
} else if let nested = self[keyPath: nkp] as? _KeyPathIterableBase {
} else if let value = self[keyPath: nkp], let nested = value as? _KeyPathIterableBase {
nested.crossReplicaSumChild(&root, joinedkp, scale)
}
}
Expand Down