Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Dictionary bug

Discussion in 'Flash' started by LeonardK, Apr 25, 2014.

  1. LeonardK

    LeonardK

    Joined:
    Mar 13, 2013
    Posts:
    10
    When the following code is compiled into flash:

    Dictionary<string, string> dummy = new Dictionary<string, string>();
    dummy.Add("1", "value2");
    foreach (KeyValuePair<string, string> keyValuePair in dummy)
    {
    Debug.Log("Key: "+keyValuePair.Key + " value: "+ keyValuePair.Value);
    }
    Output is:
    Key: null value: value2

    When I check, if dummy.ContainsKey("1") - it returns true.

    It seems like it is a bug in Dictionary implementation for flash - enumeration of keyValues is not working correctly.
    is there any chances for a fix?
     
  2. LeonardK

    LeonardK

    Joined:
    Mar 13, 2013
    Posts:
    10
    Anyone?