Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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?