Commit Graph

5 Commits

Author SHA1 Message Date
Michael Bull
e455be2cc8 Make lambda return type of expect{Err} return Any
When constructing the exception message the toString method will be
implicitly called on the result of the lambda.

Takes inspiration from Kotlin's require function [1].

[1]: https://github.com/JetBrains/kotlin/blob/v1.2.0/libraries/stdlib/src/kotlin/util/Preconditions.kt#L26
2017-11-28 18:23:36 +00:00
Michael Bull
ad7adacf39 Lazily evaluate message argument in expect/expectError 2017-11-22 23:25:28 +00:00
Michael Bull
af13c9ee7c Rename Error class to Err
Avoids naming conflict with the stdlib's Error class, also now matches
Rust's naming.
2017-10-22 16:08:26 +01:00
Michael Bull
dc4101b8ef Remove factory methods and expose Ok/Error constructors
Also converts them to data classes.
2017-10-22 16:07:24 +01:00
Michael Bull
bf3aaee77b Move to new package name 2017-10-22 00:59:16 +01:00