tailor
tailor copied to clipboard
Parsing failure when omitting name of associated value in enum
Tailor Version: v0.11.1
Swift Version: 3.0.1
Platform (Mac/Linux/Windows/CI): Mac
Installation Method: Homebrew
Steps to Reproduce Issue
- Make a new file with
enum DataState<T> {
case empty
case any(data: T)
}
enum TableViewState<T: String> {
case data(_: DataState<T>)
case error
}
Expected Behavior
File parsed
Actual Behavior
Parsing failed:
line 8:12 mismatched input '_' expecting ')'
@valerianb, thanks for reporting. We are looking into it.
@valerianb, I apologize for the delayed response. It looks like the code snippet you shared does not compile.
I removed : String from the sample code you shared and tailor appears to parse it correctly.
Would you be able to provide an example that compiles and illustrates the parsing failure you are experiencing?
No worries for the delay.
Here's the original code:
enum TableViewDataState<T> {
case empty(infoViewContent: InfoViewContent, data: T)
case any(data: T)
}
enum TableViewErrorState {
case offline(infoViewContent: InfoViewContent)
case error(infoViewContent: InfoViewContent)
}
enum TableViewState<T: DateableResult> {
case data(_: TableViewDataState<T>)
case error(_: TableViewErrorState)
case placeholder
}
protocol DateableResult {
var age: Date { get }
}
Result of tailor: Analyzing 1 file: line 15:12 mismatched input '_' expecting ')'