Skip to content

Instantly share code, notes, and snippets.

@guidomb
Created September 25, 2017 23:25
Show Gist options
  • Save guidomb/9c2651a84ca3dc1eb1084cf6593f5a53 to your computer and use it in GitHub Desktop.
Save guidomb/9c2651a84ca3dc1eb1084cf6593f5a53 to your computer and use it in GitHub Desktop.
Example variations of code that may reproduce a Swift compiler bug
// This compiles
let refreshState: RefreshState<String> = .searching
let refreshProperties: RefreshProperties<String> = properties(state: refreshState) {
print("")
$0.title = NSAttributedString(string: "Collection refresh")
}
print(refreshProperties)
// This compiles
let refreshState: RefreshState<String> = .searching
let refreshProperties: RefreshProperties<String> = properties(state: refreshState) {
let title = NSAttributedString(string: "Collection refresh")
$0.title = title
}
print(refreshProperties)
// This does not compile
let refreshState: RefreshState<String> = .searching
let refreshProperties: RefreshProperties<String> = properties(state: refreshState) {
$0.title = NSAttributedString(string: "Collection refresh")
}
print(refreshProperties)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment