-
Notifications
You must be signed in to change notification settings - Fork 926
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 warning in task :kotlin:compileKotlin #4368
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4368 +/- ##
=========================================
Coverage 73.53% 73.54%
- Complexity 17648 17652 +4
=========================================
Files 1500 1500
Lines 66010 66010
Branches 8328 8328
=========================================
+ Hits 48540 48544 +4
+ Misses 13254 13249 -5
- Partials 4216 4217 +1
Continue to review full report at Codecov.
|
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.
Thanks, @j-min5u! ❤️
@@ -29,14 +29,14 @@ import kotlinx.coroutines.future.await | |||
* | |||
* @see JacksonObjectMapperProvider | |||
*/ | |||
suspend inline fun <reified T> RestClientPreparation.execute(): ResponseEntity<T> { | |||
suspend inline fun <reified T : Any> RestClientPreparation.execute(): ResponseEntity<T> { |
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.
Note: https://stackoverflow.com/questions/63535390/how-is-any-upper-bound-in-kotlin-different-from-the-default-no-bounds
I didn't know that <T>
bound is the same as <T : Any?>
. TIL 🙇♂️
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.
Thanks @j-min5u ! 🙇 👍 🙇
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.
Thanks, @j-min5u!
Motivation:
Noticed some warnings while building the project:
> Task :kotlin:compileKotlin w: Argument -Xopt-in is deprecated. Please use -opt-in instead w: /Users/wjdalstn/Documents/GitHub/armeria/kotlin/src/main/kotlin/com/linecorp/armeria/client/kotlin/CoroutineRestClient.kt: (33, 12): Type parameter 'T' has nullable upper bounds while non-nullable version is expected. This warning will become an error soon. See https://youtrack.jetbrains.com/issue/KT-36770 for details w: /Users/wjdalstn/Documents/GitHub/armeria/kotlin/src/main/kotlin/com/linecorp/armeria/client/kotlin/CoroutineRestClient.kt: (33, 20): Type parameter 'T' has nullable upper bounds while non-nullable version is expected. This warning will become an error soon. See https://youtrack.jetbrains.com/issue/KT-36770 for details w: /Users/wjdalstn/Documents/GitHub/armeria/kotlin/src/main/kotlin/com/linecorp/armeria/client/kotlin/CoroutineRestClient.kt: (41, 12): Type parameter 'T' has nullable upper bounds while non-nullable version is expected. This warning will become an error soon. See https://youtrack.jetbrains.com/issue/KT-36770 for details w: /Users/wjdalstn/Documents/GitHub/armeria/kotlin/src/main/kotlin/com/linecorp/armeria/client/kotlin/CoroutineRestClient.kt: (41, 20): Type parameter 'T' has nullable upper bounds while non-nullable version is expected. This warning will become an error soon. See https://youtrack.jetbrains.com/issue/KT-36770 for details
Perhaps something related to the definitly non nullable types feature since kotlin 1.6.20
Modifications:
Result:
no warnings!