Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck committed Mar 11, 2024
1 parent ecf9d1e commit b3c483f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 29 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- master
- test-*
pull_request:
workflow_dispatch:
inputs:
Expand Down
35 changes: 6 additions & 29 deletions results.nim
Original file line number Diff line number Diff line change
Expand Up @@ -300,43 +300,20 @@ type
## https://github.com/nim-lang/Nim/issues/13799 - type issues
## https://github.com/nim-lang/Nim/issues/8745 - genericReset slow
## https://github.com/nim-lang/Nim/issues/13879 - double-zero-init slow
## https://github.com/nim-lang/Nim/issues/14318 - generic error raises pragma
## https://github.com/nim-lang/Nim/issues/14318 - generic error raises pragma (fixed in 1.6.14+)

# TODO https://github.com/nim-lang/Nim/issues/20699
# case oResultPrivate: bool
# of false:
# eResultPrivate: E
# of true:
# vResultPrivate: T

# TODO ResultPrivate works around
# * https://github.com/nim-lang/Nim/issues/3770
# * https://github.com/nim-lang/Nim/issues/20900
#
# Do not use these fields directly in your code, they're not meant to be
# public!
when T is void:
when E is void:
oResultPrivate*: bool
else:
case oResultPrivate*: bool
of false:
eResultPrivate*: E
of true:
discard
else:
when E is void:
case oResultPrivate*: bool
of false:
discard
of true:
vResultPrivate*: T
else:
case oResultPrivate*: bool
of false:
eResultPrivate*: E
of true:
vResultPrivate*: T
case oResultPrivate*: bool
of false:
eResultPrivate*: E
of true:
vResultPrivate*: T

Opt*[T] = Result[T, void]

Expand Down

0 comments on commit b3c483f

Please sign in to comment.