Issue with Icecs 3.3.0

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

It seems that Dictionaries are not well generated with ice 3.3.0.

See what I got :
public static _System.Collections.Generic.Dictionary<castor.UnderlyingCrossCorrelationKey, castor.CorrelationStress> read(IceInternal.BasicStream is__)
        {
            int sz__ = is__.readSize();
            _System.Collections.Generic.Dictionary<castor.UnderlyingCrossCorrelationKey, castor.CorrelationStress> r__ = new _System.Collections.Generic.Dictionary<castor.UnderlyingCrossCorrelationKey, castor.CorrelationStress>();
            for(int i__ = 0; i__ < sz__; ++i__)
            {
                castor.UnderlyingCrossCorrelationKey k__;
                v__ = new castor.UnderlyingCrossCorrelationKey();
                k__.read__(is__);
                is__.readObject(new Patcher__("::castor::CorrelationStress", r__, k__));
            }
            return r__;
        }

"v__" is not declared and I have the same behaviour with all my dictionaries. I thik "k__" should replace it.

See another example :
public static _System.Collections.Generic.Dictionary<castor.CrossKey, double> read(IceInternal.BasicStream is__)
        {
            int sz__ = is__.readSize();
            _System.Collections.Generic.Dictionary<castor.CrossKey, double> r__ = new _System.Collections.Generic.Dictionary<castor.CrossKey, double>();
            for(int i__ = 0; i__ < sz__; ++i__)
            {
                castor.CrossKey k__;
                v__ = new castor.CrossKey();
                k__.read__(is__);
                double v__;
                v__ = is__.readDouble();
                r__[k__] = v__;
            }
            return r__;
        }

This time, another variable "v__" is declared and used after...

Comments

  • dwaynedwayne St. John's, NewfoundlandDwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications EngineMember
    Hi,

    Could you post the slice that was used to generate these functions?

    Dwayne
  • die_gestaltdie_gestalt Hanz FünzingerOrganization: self-employedProject: Various projects, trying to learn IceMember
    Here's an example :
    module Test
    {
    	
    	struct Key
        {
            long Key1;
            long Key2;
        };
        
        dictionary<Key, double> Dict;
    
    }; // module Test
    

    It gives :
    public static _System.Collections.Generic.Dictionary<Test.Key, double> read(IceInternal.BasicStream is__)
            {
                int sz__ = is__.readSize();
                _System.Collections.Generic.Dictionary<Test.Key, double> r__ = new _System.Collections.Generic.Dictionary<Test.Key, double>();
                for(int i__ = 0; i__ < sz__; ++i__)
                {
                    Test.Key k__;
                    v__ = new Test.Key();
                    k__.read__(is__);
                    double v__;
                    v__ = is__.readDouble();
                    r__[k__] = v__;
                }
                return r__;
            }
    
  • dwaynedwayne St. John's, NewfoundlandDwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications EngineMember
    I have posted a source patch for slice2cs here. Thanks for the bug report.

    Dwayne
  • die_gestaltdie_gestalt Hanz FünzingerOrganization: self-employedProject: Various projects, trying to learn IceMember
    Ok thank you !
Sign In or Register to comment.