-
-
Notifications
You must be signed in to change notification settings - Fork 755
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
Extend CanBeNonNullable rule to check function params #4431
Changes from 23 commits
47e858e
7abf6ae
9197f1b
7a50a9a
0992e7d
b642aa9
e5ecb4a
b0a3cda
82f5f85
2d48819
6a2bdc8
408e7ec
a260193
8a381b5
d8aef95
e95d7ab
73790f1
b3445d9
9d22662
c69f3c4
f9e938e
08bc3fe
9f07ecc
9875284
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 |
---|---|---|
|
@@ -65,5 +65,5 @@ class ExceptionRaisedInUnexpectedLocation(config: Config = Config.empty) : Rule( | |
private fun isPotentialMethod(function: KtNamedFunction) = methodNames.any { function.name == it } | ||
|
||
private fun hasThrowExpression(declaration: KtExpression?) = | ||
declaration?.anyDescendantOfType<KtThrowExpression>() == true | ||
declaration?.anyDescendantOfType<KtThrowExpression>() ?: false | ||
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. Is this change needed? Both do the same and I don't see why one should be promoted over the other 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 is probably code from an older iteration and should be reverted. |
||
} |
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.
I agree that this code is better (we don't need to loop the collection). But was the previous code flagged by
CanBeNonNullable
? I don't think it should.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.
I think this is code from an older iteration and can probably be reverted.