Argo: Error: Expression was too complex to be solved in reasonable time
I’m getting an error Expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions
when using Argo to parse GitHub’s pull request JSON into my struct. I have the following decoder:
static var decoder: JSONValue -> PullRequest? {
return PullRequest.create
<^> <|"number"
<*> <|"state"
<*> <|"title"
<*> <||"labels"
<*> <|*"created_at"
<*> <|*"updated_at"
<*> <|*"merged_at"
<*> <|*"closed_at"
<*> <|["user", "login"]
<*> <|*"assignee"
<*> <|["repository", "owner", "login"]
<*> <|"comments"
<*> <|"html_url"
<*> <|*"statuses_url"
}
That is 14 properties for the pull request entity from GitHub’s API (which returns a ton more). I’m currently using the code in #2 as master
would lead to the compiler and indexer more or less hanging (they did not but they never finished in reasonable time ^^).
This seems to be caused by a bug in swiftc where only 11 statements per expression works.
Do you have a suggestion for workaround of this? As it would be great to be able to have more than 11 properties 😄
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 32 (13 by maintainers)
its so damn beautiful and yet so damn not usable right now it’s traagic 😭