@availability not checked in swift 5.9

When I try to use the protocol CodingKeysRepresentable that is marked with this availability: (iOS 15.4) CodingKeyRepresentable | Apple Developer Documentation

The app builds without any issues at compile time, even though the target is set to iOS 15.0. There were similar issues in the past related to availability checking for protocol conformances. It seems that protocol inheritance does not trigger @available compiler errors. Availability checking for protocol conformances
Protocol inheritance does not trigger @available compiler errors

Duplicate of issue swiftlang/swift#62769, which was closed as "not a bug"?

Can you share a self-contained test case?

The expected behavior is that a type is allowed to conform to a less-available protocol, but if you try to use the conformance from the wrong context we’re supposed to diagnose an error.

1 Like