Commit Graph

2 Commits

Author SHA1 Message Date
Allan Shortlidge
1c9b6eb723 Sema: Relax availability of typealiases for inferred type witness.
Only constrain the availability of the synthesized typealias for an inferred
type witness by the availability of the associated type if the associated type
is less available than its protocol. Without this, source compatibility is
broken for some conformances. For example:

```
struct IdentifiableValue: Identifiable {
  let id = 42
}

extension IdentifiableValue {
  // error: 'ID' is only available in macOS 10.15 or newer
  var nextID: ID {
    return id + 1
  }
}

```

Fixes a regression introduced by https://github.com/swiftlang/swift/pull/71496.

Resolves rdar://134584323
2024-08-23 15:49:51 -07:00
Matthew Johnson
0a8f154ab2 Add Identifiable protocol to the standard library 2019-07-09 14:17:20 -05:00