Giter VIP home page Giter VIP logo

Comments (6)

martinflorek avatar martinflorek commented on August 21, 2024 1

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.

from ast.

drieks avatar drieks commented on August 21, 2024

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

from ast.

martinflorek avatar martinflorek commented on August 21, 2024

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...

from ast.

drieks avatar drieks commented on August 21, 2024

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)

from ast.

martinflorek avatar martinflorek commented on August 21, 2024

I have added a minimalistic example in #2 that leads to weird AST structure which crashes after calling summary() on it.

from ast.

drieks avatar drieks commented on August 21, 2024

I think this issue is resolved now, like #2.

from ast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.