AnyObject key path diagnostic is broken #73521
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
The following code has a compile error:
According to this very old comment
AnyObject
key paths are forbidden for Objective-C messaging reasons. I'm not sure that still applies, but I would expect anAnyObject
to be able to apply anAnyKeyPath
regardless.Stranger still, the diagnostic goes away with the mere act of copying
object
over to a local, mutable variable:Regardless of the correct behavior, I believe the above should at least behave consistently.
See also: https://forums.swift.org/t/anyobject-and-key-paths/71671
Reproduction
Expected behavior
Environment
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
Additional information
No response
The text was updated successfully, but these errors were encountered: