Created
September 25, 2017 23:25
-
-
Save guidomb/9c2651a84ca3dc1eb1084cf6593f5a53 to your computer and use it in GitHub Desktop.
Example variations of code that may reproduce a Swift compiler bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) |
Author
guidomb
commented
Sep 26, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment