treeCopy() of root is not final

Issue #234 new
Jesper Mattsson created an issue

When doing treeCopy() or treeCopyNoTransform() on a node of a root type, then the resulting node is not final. This means that no nodes in the new tree will ever be final.

Might need coordination with #167?

Comments (2)

  1. Jesper Öqvist

    This should be fixed in the legacy rewrite implementation, but when using circular NTA rewrites this becomes a non-issue as the "final" flag has been completely removed in circular NTA rewrite mode. I'm not sure if/when this bug will be fixed in the legacy rewrite mode, but a huge problem with the legacy rewrite implementation is difficult understand it fully, so it's difficult to fix one bug without at the same time breaking other things. In contrast circular NTA rewrites are conceptually much more simple, and even the implementation is very simple (in my opinion).

    I think it would be beneficial in the long term for JModelica to migrate to circular NTAs. I recently migrated ExtendJ to use circular NTA rewrites, and after fixing some caching induced circular evaluation errors it seems to work well with only a 3% decrease in compile performance. To be able to use circular NTAs I implemented a few improvements in the implementation which will be in the next JastAdd release.

  2. Log in to comment