Skip to content

Ada code generated does not compile with SEQUENCE SIZE(XXX) OF CHOICE #353

@jmmery-dev

Description

@jmmery-dev

Hi,

the XER code generated for Ada does not compile:

generated/bug_xer.adb:657:66: error: expected type "XString" defined at adaasn1rtl-encoding-xer.ads:10 ( TEST_CHOICE_XER_Encode_aux(val.Data(i1), null, bs, ret); )
/generated/bug_xer.adb:657:66: error: found type universal access

procedure LIST_OF_CHOICE_XER_Encode_aux(val : LIST_OF_CHOICE; xmlTag : adaasn1rtl.encoding.xer.XString; bs : in out adaasn1rtl.encoding.xer.CharStream; ret : OUT adaasn1rtl.ASN1_RESULT)
is
    i1:Integer;
begin
    ret := LIST_OF_CHOICE_IsConstraintValid(val);
    if ret.success then
        -- SEQUENCE OF Encode
        adaasn1rtl.encoding.xer.Xer_EncodeComplexElementStart(bs, xmlTag, ret, 0);
        if ret.Success then
        	i1 := 1;
        	while i1<= 3 and ret.Success loop
                        -- Here Is the Problem
        		TEST_CHOICE_XER_Encode_aux(val.Data(i1), null, bs, ret);
        		i1 := i1 + 1;
        	end loop;
            if ret.Success then
                adaasn1rtl.encoding.xer.Xer_EncodeComplexElementEnd(bs, xmlTag, ret, 0);
        		ret.ErrorCode := (if ret.Success then 0 else ERR_XER_ENCODE_LIST_OF_CHOICE);
            end if;
        end if;
    end if;
end LIST_OF_CHOICE_XER_Encode_aux;

when doing tests with sequence with named attributes no problem

my version of asn1scc is build from sources : tag 4.6.0.9-17
my gnat is GNAT 13.3.0

here is my test project

bugtrackasn1scc_4.tar.gz

thx for you works

Regards

Jean-Michel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions