This is intentional. WritableKeyPath provides the unconditional ability to write to a path and a key path using optional chaining is conditional by nature. We would need a new key path type like OptionalWritableKeyPath that provides the conditional ability for writing.
Thinking about how this worked before the advent of key paths, and continues to work, will be helpful. I.e. there has never been a way to assign an optional to the end of an optional chain, unless that value itself were optional. E.g. how can you make only xnil, while leaving a value for y? It's a nonsensical proposition.
foo.point?.x = 42 as Optional // Cannot assign value of type 'Optional<Int>' to type 'CGFloat'
foo.point?.x = nil // 'nil' cannot be assigned to type 'CGFloat'
b is KeyPath<Foo, CGFloat?>. It cannot also be WritableKeyPath<Foo, CGFloat>. The closure signatures look related, but the type system doesn't have a concept of how to relate them like a meatperson does:
There is optionality in that "setter", but it's not "a CGFloat or no CGFloat", like the "getter". It's "Void if a value was set, and if not, no Void". WriteableKeyPath requires the input and output types to be completely symmetrical—and that optionality flipping breaks the symmetry.
Interestingly (to me), I realized that you can remove writability without a chained path. Is this useful, or just a necessary artifact of supporting chaining?