You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/EmbeddedSwift/UserManual.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -164,15 +164,15 @@ func sayHello() {
164
164
}
165
165
```
166
166
167
-
Additionally, you can also use an attribute (also experimental, and not source stable) to make entire functions, types and other declarations unavailable in Embedded Swift. This can be particularly useful to explicitly mark your own code (and also entire types and conformances) that relies on features unavailable in Embedded Swift, e.g. existentials or strings -- it is explicitly allowed to use those in unavailable contexts:
167
+
Additionally, you can also use an attribute (also experimental, and not source stable) to make entire functions, types and other declarations unavailable in Embedded Swift. This can be particularly useful to explicitly mark your own code (and also entire types and conformances) that relies on features unavailable in Embedded Swift, e.g. the Any type or Codable -- it is explicitly allowed to use those in unavailable contexts:
168
168
169
169
```swift
170
170
@_unavailableInEmbedded
171
-
funcuseAnExistential(_: Any) { ... }
171
+
funcuseAny(_: Any) { ... }
172
172
173
173
@_unavailableInEmbedded
174
-
extensionMyStruct: CustomStringConvertible{
175
-
var description: String { return"..." }
174
+
extensionMyStruct: Codable{
175
+
...
176
176
}
177
177
```
178
178
@@ -183,7 +183,7 @@ Embedded Swift is a subset of the Swift language, and some features are not avai
-**Not available**: Values of protocol types ("existentials"), e.g. `let a: Hashable = ...`, are not allowed. `Any`and `AnyObject` are also not allowed.
186
+
-**Not available**: Values of protocol types ("existentials"), unless the protocol is restricted to be class-bound (derived from AnyObject). E.g. `let a: Hashable = ...` is not allowed. `Any`is also not allowed.
187
187
-**Not available**: Metatypes, e.g. `let t = SomeClass.Type` or `type(of: value)` are not allowed.
188
188
-**Not available**: Printing and stringification of arbitrary types (achieved via reflection in desktop Swift).
189
189
-**Not available yet (under development)**: Swift Concurrency.
0 commit comments