Skip to content

Fix incorrect handling of ANY_DERIVED in FORTE export#2340

Open
AryanMishra1789 wants to merge 1 commit intoeclipse-4diac:developfrom
AryanMishra1789:fix/any-derived-export
Open

Fix incorrect handling of ANY_DERIVED in FORTE export#2340
AryanMishra1789 wants to merge 1 commit intoeclipse-4diac:developfrom
AryanMishra1789:fix/any-derived-export

Conversation

@AryanMishra1789
Copy link
Copy Markdown
Contributor

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

…ntercepts GenericTypes.ANY_DERIVED to prevent incorrect _dtp or _variant suffixes during code generation.
@github-actions
Copy link
Copy Markdown

Test Results

  110 files  ±0    110 suites  ±0   1m 10s ⏱️ -2s
6 128 tests ±0  6 128 ✅ ±0  0 💤 ±0  0 ❌ ±0 
6 129 runs  ±0  6 129 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit b09544d. ± Comparison against base commit 09d3056.

Comment on lines +213 to +214
// match ANY_DERIVED exclusively
DataType case type === GenericTypes.ANY_DERIVED: '''CIEC_ANY_DERIVED'''
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, forte_any_derived_variant would be correct, which can be achieved by reordering the switch cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants