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

Fix FileAlreadyExistsException #414

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Conversation

vRallev
Copy link
Contributor

@vRallev vRallev commented Jul 10, 2024

Classes keep being processed multiple times and throw a FileAlreadyExistsException in multi round scenarios. The function getSymbolsWithAnnotation() returns deferred symbols twice for some reason in the next round.

The fix is only applied for classes and not functions yet, because there the issue didn't occur. More care should also be taken for functions, because the qualified name alone is not an indicator to distinguish functions as functions be overloaded and have different parameters.

@vRallev vRallev force-pushed the ralf/file-already-exists branch from 0d2250d to 78b4a36 Compare July 10, 2024 18:34
@vRallev vRallev marked this pull request as ready for review July 10, 2024 18:41
// Classes keep being processed multiple times and throw a FileAlreadyExistsException in multi round
// scenarios. The function above getSymbolsWithAnnotation returns deferred symbols twice for some
// reason in the next round.
it.qualifiedName
Copy link
Owner

Choose a reason for hiding this comment

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

Simple enough, I assume a ksp issue is filed for it? Would be nice to include in the comment here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Classes keep being processed multiple times and throw a `FileAlreadyExistsException` in multi round scenarios. The function `getSymbolsWithAnnotation()` returns deferred symbols twice for some reason in the next round.

The fix is only applied for classes and not functions yet, because there the issue didn't occur. More care should also be taken for functions, because the qualified name alone is not an indicator to distinguish functions as functions be overloaded and have different parameters.
@vRallev vRallev force-pushed the ralf/file-already-exists branch from 78b4a36 to 7936e26 Compare July 10, 2024 21:14
@evant evant merged commit eac8619 into evant:main Jul 10, 2024
2 checks passed
@vRallev vRallev deleted the ralf/file-already-exists branch July 10, 2024 21:47
github-merge-queue bot pushed a commit to slackhq/circuit that referenced this pull request Sep 16, 2024
This introduces support for kotlin-inject + kotlin-inject-anvil. Note
that kotlin-inject needs another release with
evant/kotlin-inject#414 to work, so I'm game
putting this in the release now but mentioning this caveat. Will remove
the snapshots use and just disable the new sample project for now.

kotlin-inject-anvil has support for options coming too, but in the
meantime I think it's actually fine to check in an anvil hint property
too as it doesn't require any runtime anvil APIs and can just be
compileOnly.

**TODO in the future**

- [x] Need a new kotlin-inject release for
evant/kotlin-inject#414
- [x] Need anvil support for annotation options:
amzn/kotlin-inject-anvil#24
- [ ] Migrate STAR sample (can be a later PR if need be)
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