Closed martinflorek closed 5 years ago
Hi @martinflorek, please try Version 4f20128eaf
.
I removed KlassArgument and the constructor is now reported as KlassDeclaration(constructor)
, including all arguments (also of type KlassDeclaration
)
You can find the new AST structure of your test case here: https://github.com/kotlinx/ast/blob/4f20128eaf4d5d59b6c68448bfa53c266c823eec/kotlin/src/commonTest/resources/testdata/ConstructorParametersAndProperties.summary.txt
Now all my tests are crashing on calling summary()
i.e. KotlinAstParser.parseKotlinFile(source).summary()
throws java.lang.UnsupportedOperationException: Empty collection can't be reduced.
.
Parsing anything leads to a new structure and summary()
does not work anymore...
Sorry, this is not true. The constructor works OK and I have other special case that is causing the crash with summary()
. I will try to isolate it into a small test case.
Hi @martinflorek, can you provide a stacktrace? Or a small kotlin file example causing this?
All unit tests included in kotlinx.ast
are working fine, I think you have something in your kotlin files that is not included in the tests.
I will add a test that tries to parse https://github.com/arrow-kt/arrow to find the bug this evening (I'm living in Germany, currently GMT+2)
I have added a minimalistic example in #2 that leads to weird AST structure which crashes after calling summary()
on it.
I think this issue is resolved now, like #2.
The parser now handles "escaped" characters inside annotations' values but I have found another missing node.
The AST does not contain constructor parameters and properties declared in constructor e.g.: