Skip to content

Commit 671a18b

Browse files
committed
fix: Ability to configure nested reference types in getonly value types
1 parent 71fba01 commit 671a18b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Sources/FunctionalBuilder/Builder.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ extension Builder {
303303
}
304304

305305
public subscript<LocalValue>(
306-
dynamicMember keyPath: WritableKeyPath<Value, LocalValue>
307-
) -> CallableBlock<LocalValue> where Value: AnyObject {
306+
dynamicMember keyPath: ReferenceWritableKeyPath<Value, LocalValue>
307+
) -> CallableBlock<LocalValue> {
308308
CallableBlock<LocalValue>(
309309
builder: self.builder,
310310
keyPath: self.keyPath.appending(path: .init(keyPath))
@@ -321,8 +321,8 @@ extension Builder {
321321
}
322322

323323
public subscript<Wrapped, LocalValue>(
324-
dynamicMember keyPath: WritableKeyPath<Wrapped, LocalValue>
325-
) -> CallableBlock<LocalValue?> where Wrapped: AnyObject, Value == Wrapped? {
324+
dynamicMember keyPath: ReferenceWritableKeyPath<Wrapped, LocalValue>
325+
) -> CallableBlock<LocalValue?> where Value == Wrapped? {
326326
CallableBlock<LocalValue?>(
327327
builder: self.builder,
328328
keyPath: self.keyPath.appending(

Sources/FunctionalConfigurator/Configurator.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ extension Configurator {
236236
}
237237

238238
public subscript<LocalValue>(
239-
dynamicMember keyPath: WritableKeyPath<Value, LocalValue>
240-
) -> CallableBlock<LocalValue> where Value: AnyObject {
239+
dynamicMember keyPath: ReferenceWritableKeyPath<Value, LocalValue>
240+
) -> CallableBlock<LocalValue> {
241241
.init(
242242
configurator: self.configurator,
243243
keyPath: self.keyPath.appending(path: FunctionalKeyPath(keyPath))
@@ -254,8 +254,8 @@ extension Configurator {
254254
}
255255

256256
public subscript<Wrapped, LocalValue>(
257-
dynamicMember keyPath: WritableKeyPath<Wrapped, LocalValue>
258-
) -> CallableBlock<LocalValue?> where Wrapped: AnyObject, Value == Wrapped? {
257+
dynamicMember keyPath: ReferenceWritableKeyPath<Wrapped, LocalValue>
258+
) -> CallableBlock<LocalValue?> where Value == Wrapped? {
259259
CallableBlock<LocalValue?>(
260260
configurator: self.configurator,
261261
keyPath: self.keyPath.appending(path: FunctionalKeyPath(keyPath))

0 commit comments

Comments
 (0)