-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for non-unit return types #22
Allow for non-unit return types #22
Conversation
Guess I'm gonna need some assistance for the dotty part of this ^^ |
@Baccata Nice. Thanks for the contribution. The original // should have two type parameters; one for recorded type, another for returned type
// so far failed to implement the macro side of this |
done here : 7c9fbe7 |
@eed3si9n I've attempted fixing the dotty layer, but I'm a bit stuck :
|
inline def apply(recording: Boolean): Unit = | ||
abstract class Recorder[R, A] { | ||
def listener: RecorderListener[R, A] | ||
inline def apply(recording: R): Unit = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return A
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 4122318
Awesome. Could you squash your commits please, and I think it's ready to merge. |
This adds input/output type parameters to the Recorder : * allows non boolean arguments to be captured * allow non-unit types to be returned The goal is to broaden the usage of this library, by letting people extend the Recoder class to potentially capture other types / return error-capable datatypes, etc
4122318
to
8e1daf7
Compare
Done in 8e1daf7 |
This changes the internal API to allow to return some other types than Unit, so that people can use leverage the macro to declare their own assertion functions, returing Either/Try, etc.