Sequences with slice2cs 3.3.0

die_gestaltdie_gestalt Hanz FünzingerOrganization: self-employedProject: Various projects, trying to learn IceMember
Hello,

Sequences and Dictionnaries generations seem to be wrong with slice2cs 3.3.0.

See my slice :
module TestIce
{
    sequence<long> TestSeq;
    
};

Here's the whole generated file :
namespace TestIce
{
    public sealed class TestSeqHelper
    {
        public static void write(IceInternal.BasicStream os__, long[] v__)
        {
            os__.writeLongSeq(v__);
        }

        public static long[] read(IceInternal.BasicStream is__)
        {
            long[] v__;
            v__ = is__.readLongSeq();
            return v__;
        }
    }
}

A lot of code is missing, but I did not get any error during generation.

Thank you for your help.

Comments

  • dwaynedwayne St. John's, NewfoundlandDwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications EngineMember
    Why do you think there is code missing?
  • die_gestaltdie_gestalt Hanz FünzingerOrganization: self-employedProject: Various projects, trying to learn IceMember
    Because "TestSeq" is not defined anywhere. I cannot use my sequence because it does not exist on generated file.
  • mesmes CaliforniaMark SpruiellOrganization: ZeroC, Inc.Project: Ice DeveloperAdministrators, ZeroC Staff ZeroC Staff
    Because "TestSeq" is not defined anywhere. I cannot use my sequence because it does not exist on generated file.
    The C# mapping chapter states:
    By default, sequences are mapped to arrays.
    This means the Slice-to-C# compiler does not generate a type named TestSeq, but uses a native C# array (long[]) everywhere TestSeq is expected.

    Cheers,
    Mark
  • die_gestaltdie_gestalt Hanz FünzingerOrganization: self-employedProject: Various projects, trying to learn IceMember
    Ok sorry. I did not see this change.

    Thank you for your help.
Sign In or Register to comment.