Kotlin: stub trap .class files when extracting a class from Kotlin source#11510
Merged
smowton merged 19 commits intogithub:mainfrom Dec 7, 2022
Merged
Conversation
ff2d27b to
6c79985
Compare
tamasvajk
reviewed
Dec 6, 2022
Contributor
tamasvajk
left a comment
There was a problem hiding this comment.
Added some minor comments/questions.
…ected kinds of top-level declaration
Only top-level non-class declarations need the IrFile's expected class name inserting
These resulted from the Java compiler exploring NotNull and other Kotlin-emitted annotations, which it no longer does because it finds a .class trap file already present and truncates its class-graph walk
These occur because the Companion field is odd, being extracted from source but not having an associated FieldDeclaration, leading to PrintAst enumerating the node differently depending on whether it has a source-file location or not but in either case choosing not to show it.
This was testing that a signature inconsistency occurs, but this now manifests as a db inconsistency which can't be used as a test expectation because specific tuple numbers are liable to change with the environment.
…a signature We could revert this by allowing useType to avoid triggering class-instance extraction when used just for its signature result
This is actually a bug, which we should follow up on subsequently.
6c79985 to
fc3ed22
Compare
fc3ed22 to
00f323c
Compare
Contributor
Author
|
@tamasvajk all comments addressed, and test changes accepted -- two notable changes that were needed: |
tamasvajk
reviewed
Dec 7, 2022
Contributor
tamasvajk
left a comment
There was a problem hiding this comment.
Looks okay to me apart from some CI test failures. I also added a minor comment.
Contributor
Author
|
@tamasvajk done |
tamasvajk
approved these changes
Dec 7, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will be useful for annotations, because other extractors are less likely to see a binary version of the class stripped of its source-only annotations and introduce an inconsistency.