-
-
Notifications
You must be signed in to change notification settings - Fork 784
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
[OptionalUnit] Allow a function to declare a Unit return type when it uses a generic function initializer #4371
[OptionalUnit] Allow a function to declare a Unit return type when it uses a generic function initializer #4371
Conversation
… function initializer
@@ -9,6 +9,7 @@ import io.gitlab.arturbosch.detekt.api.Rule | |||
import io.gitlab.arturbosch.detekt.api.Severity | |||
import io.gitlab.arturbosch.detekt.rules.isOverride | |||
import org.jetbrains.kotlin.cfg.WhenChecker | |||
import org.jetbrains.kotlin.js.translate.callTranslator.getReturnType |
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.
No idea why this is in a JavaScript package, but it appears to work in JVM code.
Codecov Report
@@ Coverage Diff @@
## main #4371 +/- ##
============================================
+ Coverage 84.26% 84.29% +0.02%
- Complexity 3263 3275 +12
============================================
Files 473 473
Lines 10336 10340 +4
Branches 1827 1830 +3
============================================
+ Hits 8710 8716 +6
Misses 667 667
+ Partials 959 957 -2
Continue to review full report at Codecov.
|
…ing are provided; Slight optimization in OptionalUnit for determining whether a function has an explicit return type
@BraisGabin I'm not sure what I'm supposed to do here. CodeCov is requiring that I write a test where one of the two lines below returns a null value:
Otherwise, the PR is not hitting the target rate of 80% code coverage. The problem is that writing that test would require creating a code snippet where, for example, the function initializer isn't recognized (e.g. |
Don't care about that. If the tests really cover the main logic it's enough. If you check you are under the target but even with that you are increasing the coverage. |
This addresses issue #4363.