Skip to content
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

Restore allWarningsAsErrors in main source-sets #4336

Merged
merged 5 commits into from
Feb 11, 2025
Merged

Conversation

qwwdfsad
Copy link
Collaborator

No description provided.

@qwwdfsad qwwdfsad marked this pull request as ready for review January 23, 2025 17:52
@qwwdfsad qwwdfsad requested a review from dkhalanskyjb January 23, 2025 17:52
@qwwdfsad
Copy link
Collaborator Author

Let's merge it and with the next step I'll enable it in the dev builds

@@ -64,7 +66,7 @@ public actual fun <T> runBlocking(context: CoroutineContext, block: suspend Coro
var completed = false
ThreadLocalKeepAlive.addCheck { !completed }
try {
@Suppress("LEAKED_IN_PLACE_LAMBDA") // Contract is preserved, invoked immediately or throws

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this newline a typo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, fixed

@@ -316,6 +316,7 @@ public class PublisherCoroutine<in T>(
signalCompleted(cause, handled)
}

@Deprecated("Since 1.2.0, binary compatibility with versions <= 1.1.x", level = DeprecationLevel.HIDDEN)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binary compatibility is not the only reason why we have this method. If we remove it, the Subscription interface is no longer implemented. In fact, I'd argue it's a bug that this code causes a warning: https://youtrack.jetbrains.com/issue/KT-74697/Overriding-a-method-thats-both-deprecated-and-non-deprecated-should-not-cause-warnings

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

I propose to leave it as is here because for users everything keeps working (i.e. PublisherCoroutine,cancel is not exposed) and we do not provide any new documentation here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't object to @Deprecated, as long as the error message honestly states the reason and doesn't mislead.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I think about it more, @Deprecated is slightly worse than a suppression, because if https://youtrack.jetbrains.com/issue/KT-74697 does get fixed, we'll be notified about it via the "redundant suppression" message, whereas the deprecation is with us to stay.

@qwwdfsad qwwdfsad requested a review from dkhalanskyjb January 27, 2025 14:22
@@ -316,6 +316,7 @@ public class PublisherCoroutine<in T>(
signalCompleted(cause, handled)
}

@Deprecated("Since 1.2.0, binary compatibility with versions <= 1.1.x", level = DeprecationLevel.HIDDEN)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I think about it more, @Deprecated is slightly worse than a suppression, because if https://youtrack.jetbrains.com/issue/KT-74697 does get fixed, we'll be notified about it via the "redundant suppression" message, whereas the deprecation is with us to stay.

@qwwdfsad qwwdfsad requested a review from dkhalanskyjb February 6, 2025 19:00
@dkhalanskyjb dkhalanskyjb merged commit b1711eb into develop Feb 11, 2025
1 check passed
@dkhalanskyjb dkhalanskyjb deleted the return-werror branch February 11, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants