Add alias for "fail"

This commit is contained in:
2020-07-02 18:10:48 +02:00
parent 6bd1a41515
commit 2f1f5ed2f8
2 changed files with 21 additions and 1 deletions

View File

@@ -45,3 +45,7 @@ proc fail*[T](msg: string): OP[T] =
assert res.error == "Something is wrong!"
OP[T](isOK: false, error: msg)
proc fail*(T: typedesc, msg: string): OP[T] =
## Alias for `fail[T](string) proc <#fail,string>`_
fail[T] msg