-
Notifications
You must be signed in to change notification settings - Fork 88
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
use type checkers in fit.R
#1182
Conversation
@@ -533,6 +533,21 @@ check_case_weights <- function(x, spec, call = rlang::caller_env()) { | |||
invisible(NULL) | |||
} | |||
|
|||
# ------------------------------------------------------------------------------ | |||
|
|||
check_inherits <- function(x, cls, arg = caller_arg(x), call = caller_env()) { |
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.
Decided to write out inher()
in favor of this helper. I think we could probably get a good bit of mileage out of this based on the number of if (inherits(
in this repo.
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.
100%, and the name is much better too!
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.
so happy to see this being done!
@@ -533,6 +533,21 @@ check_case_weights <- function(x, spec, call = rlang::caller_env()) { | |||
invisible(NULL) | |||
} | |||
|
|||
# ------------------------------------------------------------------------------ | |||
|
|||
check_inherits <- function(x, cls, arg = caller_arg(x), call = caller_env()) { |
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.
100%, and the name is much better too!
Co-authored-by: Emil Hvitfeldt <[email protected]>
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
Closes #1181.🐝