[SR-5069] Error referring to enum case in a dot-referenced function call ending with a closure. #47645
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Additional Detail from JIRA
md5: 5f83b01c4a5465659cec4d38a86e1f2e
Issue Description:
The following code probably shouldn't create an error. But it does.
Playground execution failed: error: MyPlayground.playground:5:21: error: enum element 'begin' cannot be referenced as an instance member
let z: Z = .create(.begin) { $0.e = .end }
^
Tested with Xcode 8.3.2 both with the built-in toolchain as well as with the Swift 4.0 snapshot 2017-05-24. Fully qualifying the function name works as a workaround:
let z = Z.create(.begin) { $0.e = .end }
The text was updated successfully, but these errors were encountered: