-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Remove unused parameters from methods #1867
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ trait PartialOrderSyntax extends EqSyntax { | |
new PartialOrderOps[A](a) | ||
} | ||
|
||
final class PartialOrderOps[A](lhs: A)(implicit A: PartialOrder[A]) { | ||
final class PartialOrderOps[A](lhs: A) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have no idea about the macro expansion in machinist. I am not sure that is what is going on here anyway. I think it may be to prevent this class from being allocated without a PartialOrder. We could I'm not sure if this is even tested sadly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems no longer relevant, since macros have been now removed in preparation for Dotty. |
||
def >(rhs: A): Boolean = macro Ops.binop[A, Boolean] | ||
def >=(rhs: A): Boolean = macro Ops.binop[A, Boolean] | ||
def <(rhs: A): Boolean = macro Ops.binop[A, Boolean] | ||
|
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.
While the
NT
parameter isn't referenced at runtime, it serves an important compile-time role. Consider that you wanted to do something like the following:If you forget to add the type parameter before this PR you get a compile-time error:
However, with this PR you get a runtime error because
Null
is inferred as the type parameter:I think that the correct change to make here is to document why this
NotNull
parameter exists. The same goes for theValidated
case.