Skip to content

Add stringoutclass attribute to global element, defaulting to baseclassname#238

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-stringoutclass-issues
Draft

Add stringoutclass attribute to global element, defaulting to baseclassname#238
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-stringoutclass-issues

Conversation

Copy link

Copilot AI commented Feb 26, 2026

The global element lacked a configurable class type for the error method's instance parameter — it was hardcoded to baseclassname. This adds an optional stringoutclass attribute that defaults to baseclassname when unspecified, enabling components to designate a different class for error string propagation.

Changes

  • Source/componentdefinition.go

    • Added StringOutClass string field (stringoutclass XML attr) to ComponentDefinitionGlobal
    • Auto-defaults StringOutClass to BaseClassName in CheckComponentDefinition when absent
    • Validates that a non-default stringoutclass references an existing class
    • CheckHeaderSpecialFunction: error method's first param class is now validated against StringOutClass instead of BaseClassName
  • Source/buildimplementationcpp.go

    • IBaseClassName in buildCPPInterfaceWrapper now uses StringOutClass
    • All writeCImplementationMethod calls pass StringOutClass instead of BaseClassName, so generated handleException/handleStdException/handleUnhandledException signatures and pIBaseClass declarations use the correct type
  • Source/ACT.xsd

    • Added optional stringoutclass attribute to CT_Global
  • Source/componentdiff.go

    • diffGlobal now tracks StringOutClass changes

Usage

<!-- stringoutclass omitted → defaults to baseclassname "Base" (backward-compatible) -->
<global baseclassname="Base" acquiremethod="..." releasemethod="..." ...>

<!-- Explicit: error method takes ErrorHolder* instead of Base* -->
<global baseclassname="Base" stringoutclass="ErrorHolder" acquiremethod="..." ...>
  <method name="GetLastError">
    <param name="Instance" type="class" class="ErrorHolder" pass="in" ... />
    ...
  </method>
</global>

All existing XML files without stringoutclass are unaffected — generated output is identical to before.

Original prompt

This section details on the original issue you should resolve

<issue_title>stringoutclass issues</issue_title>
<issue_description>- stringoutclass should default to baseclass

  • global functions currently don't support string out. This will be a breaking chance to existing ACT components:
    • either implement caching for global OR
    • (better) use the old implementation of strings for global functions with string-out parameters OR
    • simply forbid it and accept the breaking change OR
    • explicitly allow it as a fallback</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: martinweismann <30837766+martinweismann@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix stringoutclass default to baseclass and global function support Add stringoutclass attribute to global element, defaulting to baseclassname Feb 26, 2026
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.

stringoutclass issues

2 participants