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
[docs][SR-9915] Compilation fix of docs snippet of type(of:)
Compilation of code sample snippets was broken due to using the same
identifier as the `type` function itself to store its result resulting
in:
```swift
func printGenericInfo<T>(_ value: T) {
let type = type(of: value)
print("'\(value)' of type '\(type)'")
}
// error: repl.swift:2:16: error: variable used within its own initial
// value
// let type = type(of: value)
// ^
```
Result:
- Snippets are more copy&paste friendly.
- Resolves https://bugs.swift.org/browse/SR-9915
0 commit comments