Fix incorrect handling of ANY_DERIVED in FORTE export#2340
Open
AryanMishra1789 wants to merge 1 commit intoeclipse-4diac:developfrom
Open
Fix incorrect handling of ANY_DERIVED in FORTE export#2340AryanMishra1789 wants to merge 1 commit intoeclipse-4diac:developfrom
AryanMishra1789 wants to merge 1 commit intoeclipse-4diac:developfrom
Conversation
…ntercepts GenericTypes.ANY_DERIVED to prevent incorrect _dtp or _variant suffixes during code generation.
mx990
requested changes
Mar 28, 2026
Comment on lines
+213
to
+214
| // match ANY_DERIVED exclusively | ||
| DataType case type === GenericTypes.ANY_DERIVED: '''CIEC_ANY_DERIVED''' |
Member
There was a problem hiding this comment.
The CIEC_ANY_DERIVED_VARIANT was actually correct. It was simply missing in 4diac FORTE. I created PR eclipse-4diac/4diac-forte#825 to add it.
Comment on lines
+332
to
+333
| AnyDerivedType case type === GenericTypes.ANY_DERIVED: | ||
| "forte_any_derived" |
Member
There was a problem hiding this comment.
In this case, forte_any_derived_variant would be correct, which can be achieved by reordering the switch cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ANY_DERIVED was incorrectly treated as a derived datatype, resulting in ANY_DERIVED_dtp.h and CIEC_ANY_DERIVED_VARIANT. This happened because it was handled by generic cases instead of as a built-in type.
Fix
Added a type-safe check using GenericTypes.ANY_DERIVED to map it to forte_any_derived.h and CIEC_ANY_DERIVED. This avoids incorrect _dtp and _VARIANT generation while preserving behavior for other types.
#2047