-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
coroc: better handle chained function calls (#100)
This fixes some odd expression decomposition I noticed. In the worst case (all functions in the chain may yield), a chain like `time.Now().UTC()` is decomposed to: ```go { _v2 := time.Now _v1 := _v2() _v0 := _v1.UTC _v0() } ``` Although this is technically correct, it can cause issues with serialization because the function types aren't necessarily registered. This PR improves the handling of `ast.CallExpr` + `ast.SelectorExpr` so that we instead get the following (in the worst case): ```go { _v0 := time.Now() _v0.UTC() } ```
- Loading branch information
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
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 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