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

DCE for user-defined extensions in atomicfu #63

Closed
qwwdfsad opened this issue Apr 29, 2019 · 3 comments
Closed

DCE for user-defined extensions in atomicfu #63

qwwdfsad opened this issue Apr 29, 2019 · 3 comments
Assignees

Comments

@qwwdfsad
Copy link
Member

Consider the following user-defined extension: private inline fun AtomicBoolean.tryAcquire(): Boolean = compareAndSet(false, true)

Currently, the postprocessor retains the original method in the bytecode. While it is okay for the Kotlin compiler to do so, it is not the case for atomicfu that should remove every trace of itself after post-processing. Otherwise, resulting classfiles are polluted with symbols that are missing from the classpath (and it may trigger warnings like Kotlin/kotlinx.coroutines#1155).

Also, note that not only extensions but their access-bridges should be removed.

@qwwdfsad
Copy link
Member Author

I think it is time to introduce a validation step to the postprocessor to avoid issues like that in the future

@elizarov
Copy link
Contributor

elizarov commented Apr 29, 2019

Hm... I thought I did fix it in ec234e4 I'll investigate what's going on there.

@elizarov
Copy link
Contributor

elizarov commented May 6, 2019

Fixed in version 0.12.7

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

No branches or pull requests

2 participants