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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The code that shows the bug is here https://github.com/guidomb/Portal/blob/d1916ecf9b187d73a1efcdb033db513d7a90ce81/Example/Views/Examples/VectiralCollectionScreen.swift#L46
The
properties
function is defined here -> https://github.com/guidomb/Portal/blob/d1916ecf9b187d73a1efcdb033db513d7a90ce81/Portal/View/RefreshControl.swift#L46The
RefreshProperties
struct is defined -> https://github.com/guidomb/Portal/blob/d1916ecf9b187d73a1efcdb033db513d7a90ce81/Portal/View/RefreshControl.swift#L18