Skip to content

Relax Kotlin contracts for Executable passed to assertTimeout #4551

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

Merged
merged 6 commits into from
May 19, 2025

Conversation

marcphilipp
Copy link
Member

@marcphilipp marcphilipp commented May 19, 2025

Overview

Since Executable is allowed/expected to throw exceptions, the
semantics of being called EXACTLY_ONCE are blurry because it might not
be executed entirely when throwing an exception. Since the Kotlin 2.1
compiler emits a warning for these parameters, we're relaxing their
contracts to be called AT_MOST_ONCE instead.


Definition of Done

Since `Executable` is allowed/expected to throw exceptions, the
semantics of being called `EXACTLY_ONCE` are blurry because it might not
be executed entirely when throwing an exception. Since the Kotlin 2.1
compiler emits a warning for these parameters, we're relaxing their
contracts to be called `AT_MOST_ONCE` instead.
@marcphilipp marcphilipp force-pushed the marc/4371-relax-kotlin-contracts branch from 0646eba to ef78d82 Compare May 19, 2025 09:50
@marcphilipp marcphilipp changed the title Relax Kotlin contracts for Executable parameters Relax Kotlin contracts for assert May 19, 2025
@marcphilipp marcphilipp changed the title Relax Kotlin contracts for assert Relax Kotlin contracts for Executable passed to assertTimeout May 19, 2025
@marcphilipp marcphilipp added this to the 6.0.0-M1 milestone May 19, 2025
@marcphilipp marcphilipp linked an issue May 19, 2025 that may be closed by this pull request
1 task
@marcphilipp marcphilipp removed this from the 6.0.0-M1 milestone May 19, 2025
@marcphilipp marcphilipp merged commit 145af95 into main May 19, 2025
13 checks passed
@marcphilipp marcphilipp deleted the marc/4371-relax-kotlin-contracts branch May 19, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Resolve Kotlin 2.1 compiler warnings for contracts
1 participant