Hi everyone,
Following up on my previous post, I’ve successfully built LFortran from source (v0.59.0) and started digging into the Legacy OO / Polymorphism features as suggested.
I spent some time analyzing the ASR (Abstract Semantic Representation) for class(*) and found a gap in the Semantics phase. While source= allocation works for intrinsic types, allocate(integer :: u) was throwing a “Not Supported” error.
I traced the issue to ast_body_visitor.cpp, where the visitor was only checking for Symbols (Derived Types) and missing a check for intrinsic types like integer or real. I’ve submitted a PR to fix this semantic check, though it currently uncovers a backend segfault (which is my next target!).
Learning a lot about how LFortran maps AST to ASR. Thanks for the guidance so far!
PR: [Semantics] Support intrinsic type-spec in ALLOCATE for class(*) by Adityazzzzz · Pull Request #9348 · lfortran/lfortran · GitHub