You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.
Unfortunately I don't speak kotlin, and have only a hazy idea of what arrow is trying to achieve, but it seems likely that it should avoid writing to synthetic fields (and probably also final static ones).
should first change the field's modifier as well as making it accessible. e.g.
it.getModifiers() & ~Modifier.FINAL
Arrow seems to work ok with jacoco as the probe field it adds to classes is non final. There may be issues with other coverage systems however (and would be with jacoco for interfaces, as the jvm spec requires final fields in this case, but I don't know enough about arrow to know if this is a valid scenario).
The text was updated successfully, but these errors were encountered:
Thank you for the report. I'll take a look ASAP. We're migrating away from the reflection hack (which I assure you is necessary 🙃) soon-ish, maybe we can have a point release with the fix.
Congratulations on Pitest by the way. I did not know it and it looks POWERFUL 🤩
I maintain http://pitest.org, a mutation testing system for java, which is also being increasingly used with kotlin.
Pitest includes a block coverage system, the implementation of which adds a synthetic static final field to each class.
This causes a runtime error with arrow as it attempts to write to the final field via reflection.
The problem can be reproduced in the following repo by running
gradlew pitest
https://github.com/Octogonapus/reproduce-pitest-problem
Unfortunately I don't speak kotlin, and have only a hazy idea of what arrow is trying to achieve, but it seems likely that it should avoid writing to synthetic fields (and probably also final static ones).
If it does need to write to final fields then
https://github.com/arrow-kt/arrow/blob/master/modules/core/arrow-core-data/src/main/kotlin/arrow/typeclasses/ContinuationUtils.kt
should first change the field's modifier as well as making it accessible. e.g.
Arrow seems to work ok with jacoco as the probe field it adds to classes is non final. There may be issues with other coverage systems however (and would be with jacoco for interfaces, as the jvm spec requires final fields in this case, but I don't know enough about arrow to know if this is a valid scenario).
The text was updated successfully, but these errors were encountered: