Avatar
(チェーンじゃないけど)SE-0287 と SE-0299 (と result builder) が組み合わさったときにうまくいかないのですね。 https://github.com/apple/swift-evolution/blob/97c3e1d35ab217d7627e1e601fff5c4b33c17ef8/proposals/0287-implicit-member-chains.md?plain=1#L118-L128
This proposal would provide the model mentioned earlier for implicit member expressions: anywhere that a contextual type T can be inferred, writing
.member1.member2.(...).memberN Will behave as if the user had written: T.member1.member2.(...).memberN https://github.com/apple/swift-evolution/blob/97c3e1d35ab217d7627e1e601fff5c4b33c17ef8/proposals/0299-extend-generic-static-member-lookup.md?plain=1#L199-L203 Toggle("Wi-Fi", isOn: $isWiFiEnabled) .toggleStyle(.switch)
In the case of .toggleStyle(.switch), the reference to the member .switch is re-written to be SwitchToggleStyle.switch in the type-checked AST.
というわけで、 おもちさんの例だと S.s { ... } と書いたときと同等に動くべきと読めるので、バグで良いと思います。
(edited)