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

"Could not parse type signature" in Kotlin test classes #645

Closed
polovkovaaa opened this issue Feb 3, 2022 · 6 comments
Closed

"Could not parse type signature" in Kotlin test classes #645

polovkovaaa opened this issue Feb 3, 2022 · 6 comments

Comments

@polovkovaaa
Copy link

Hello,

When parsing test code, an error occurs if the test method name contains parentheses, and the body contains curly brackets. Because of this, ClassInfo.isExternalClass == true and dependencies are not parsed. There is an error message in the logs "Invalid classfile: Could not parse type signature". Logs and an example project in the attached files.
class_graph_logs.txt
TestClassGraph.zip

@lukehutch
Copy link
Member

Thanks, I'm traveling right now, but I'll try to get to this in the next few days.

@lukehutch
Copy link
Member

Wait, you mean to tell me that sample test (Could not parse type signature) is a valid function name in Kotlin? :-o

I'll have to trace through to see where the paren is disallowed by the current parser...

lukehutch added a commit that referenced this issue Feb 11, 2022
@polovkovaaa
Copy link
Author

Yes, it's valid name for test methods.
Coding conventions - https://kotlinlang.org/docs/coding-conventions.html#names-for-test-methods

@lukehutch
Copy link
Member

This is fixed in the git main version, please test it and let me know if there are any more issues. I have several bugs I need to fix and close, but once that is done, this will be in the next release. Thank you for the report!

@polovkovaaa
Copy link
Author

I checked the git main version. Now it works correctly. Thank you, looking forward to the next release.

@lukehutch
Copy link
Member

Thank you for testing!

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