Skip to content

Commit e8c9d7d

Browse files
authored
Merge pull request #2493 from amritpan/patch-2
[SE-0438] Add Implications to Adoption.
2 parents c2f3632 + a49d936 commit e8c9d7d

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

proposals/0438-metatype-keypath.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,22 @@ let kpViaSubscript: KeyPath<Test, S.Type> = \Test.[42]
106106
let kpAppended = kpViaSubscript.appending(path: \.count)
107107
```
108108

109-
## ABI compatibility / Implications on adoption
109+
## ABI compatibility
110110

111-
This feature does not affect ABI compatibility and has no implications on adoption.
111+
This feature does not affect ABI compatibility.
112+
113+
## Implications on adoption
114+
115+
This feature is back-deployable but it requires emission of new (property descriptors) symbols for static properties.
116+
117+
The type-checker wouldn't allow to form key paths to static properties of types that come from modules that are built by an older compiler that don't support the feature because dynamic or static library produced for such module won't have all of the required symbols.
118+
119+
Attempting to form a key path to a static property of a type from a module compiled with a complier that doesn't yet support the feature will result in the following error with a note to help the developers:
120+
121+
```swift
122+
error: cannot form a keypath to a static property <Property> of type <Type>
123+
note: rebuild <Module> to enable the feature
124+
```
112125

113126
## Future directions
114127

0 commit comments

Comments
 (0)