Skip to content

Conversation

@montaguegabe
Copy link
Contributor

@montaguegabe montaguegabe commented Mar 13, 2022

  • All operations now have associated protocols, and internal protocols have been given more sensible names.
  • The type-flag system that was a burden for the compiler has been abolished in favor of more traditional usage of protocols.
  • Code generation has been added and used sparingly in attempt to improve readability and reduce the chance of duplication errors. See Tests/CodeGeneration/README.md
  • Values returned from then, attempt, and recover can no longer be ignored, meaning that it is no longer possible (at compile time) to call catch on these chains without another then that uses the chain's value (similar to PromiseKit's done).

In order to have a protocol called Catchable we need to conform a GenericNode to Catchable multiple times: once for if it is a Result and once for if it is a Promise. But this is not allowed. The alternatives: make subclasses rather than have everything be typealias, or have the body of `catch` switch on the type of When
Looks like we are forced into a tradeoff of two options:
1) Mark all catch bodies as `@escaping` and lose some compiler efficiency
2) Have the catchable protocol require not `catch` methods, but `catchAsync` and `catchSyncEscaping` or something like that
…protocols depending on different `where` conditions
@montaguegabe montaguegabe merged commit 522d114 into main Mar 13, 2022
@montaguegabe montaguegabe deleted the keep-type-flags-operation-protocols branch March 13, 2022 22:11
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

Successfully merging this pull request may close these issues.

2 participants