Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing failure when omitting name of associated value in enum #471

Open
valerianb opened this issue Feb 9, 2017 · 3 comments
Open

Parsing failure when omitting name of associated value in enum #471

valerianb opened this issue Feb 9, 2017 · 3 comments

Comments

@valerianb
Copy link

valerianb commented Feb 9, 2017

Tailor Version: v0.11.1

Swift Version: 3.0.1

Platform (Mac/Linux/Windows/CI): Mac

Installation Method: Homebrew

Steps to Reproduce Issue

  1. 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 ')'

@adityatrivedi
Copy link
Member

@valerianb, thanks for reporting. We are looking into it.

@adityatrivedi
Copy link
Member

adityatrivedi commented Mar 6, 2017

@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.

screen shot 2017-03-05 at 9 26 53 pm

Would you be able to provide an example that compiles and illustrates the parsing failure you are experiencing?

@valerianb
Copy link
Author

valerianb commented Mar 6, 2017

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 ')'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants