-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Kotlin bug Result unwrapping affects Atrium #1234
Comments
I would be interested in taking this up! Where do I need to be working in and is there any resources you can send to me to help get me started? |
The workaround needs to be implemented in DefaultResultAssertions: Line 37 in 190ea55
You can read the bug report for more information but besides there is not much you can read up. Note, that this is not a I suggest you base your work first on the branch https://github.com/robstoll/atrium/tree/KT-54674 |
Thanks for the info. I am still working on this, and I'm wondering how I might go about accessing the Result Kotlin provides for checking IsSuccess? Apologies if these are trivial questions, just trying to figure this out! |
@JordanllHarper it is enough if you compare |
@robstoll I'm still working on this and I'm wondering if I could submit a draft pull request for a first draft on the change to check I'm on the right lines. I've not gotten to unwrapping yet, just a check to see my comparisons would give the correct output. |
sure, you can always create a draft PR (even without asking) simplifies to understand your questions |
Apologies if this is another simple question, but how should I be testing the fix? Are there tests to run? |
No worries, just keep asking, I am here to help. There is already a ResultExpectationsSpec and one test is commented out due to the bug, search for |
Affected Version
0.18.0
API
fluent-en_GB, infix-en_GB
Platform
jvm
Kotlin Version
1.4
How to reproduce the problem?
=> is success
Describe the bug
See https://youtrack.jetbrains.com/issue/KT-50974 => fix is only provided in Kotlin 1.6.20
Expected behaviour
We want that people working with Kotlin 1.4.x and 1.5.x are not affected by this Kotlin bug.
Thus, we need to implement a workaround so that the user does not get in touch with this bug (at least when using Atrium).
We can do this by comparing
container.maybeSubject
with the (wrong) subject provided by Kotlin. In case they differ and it is a Result.isSuccess which contains another Result, then we unwrap it.The text was updated successfully, but these errors were encountered: