Fire/Silver don't iterate over some structures

For .NET dictionaries that’s as designed. foreach returns a KeyvaluePair<K,V>, you’d need to do something like:

class method Program.Main(args: array of String): Int32;

begin

  var L1 := new Dictionary<String, String>;

  var L2 := new Dictionary<String, Dictionary<String, String>>;

  var L3 := new Dictionary<String, Dictionary<String, Dictionary<String, String>>>;



  L1['A'] := '1';

  L1['B'] := '2';

  L2['C'] := L1;

  L3['D'] := L2;



  for each v3 in L3 index k3 do begin

    writeLn(k3 + ":");

    for each v2 in v3.Value index k2 do begin

      writeLn("   " + k2 + ":");

      for each v1 in v2.Value index k1 do begin

        writeLn("    " + k1 + ": " + v1);

      end;

    end;

  end;

end;

bugs://73153 got closed with status fixed.

The swift version still don’t work.

Compiling to dotNet the code run and fail to show the last element and compiling to Jaa don’t run.

Follow the code again:

import System.Collections.Generic
import System.Linq
import System.Text
var L1 = [String: [String: [String: String]]]()
var L2 = [String: [String: String]]()
var L3 = [String: String]()
L3["A"] = "1"
L3["B"] = "2"
L2["C"] = L3
L1["D"] = L2
for (k3, v3) in L3 {
	println(k3 + ": " + v3)
}
println()
for (k2, v2) in L2 {
	println(k2 + ": ")
	for (k3, v3) in v2 {
		println("   " + k3 + ":" + v3)
	}
}
println()
for (k1, v1) in L1 {
	println(k1 + ":")
	for (k2, v2) in v1 {
		println("   " + k2 + ":")
		for (k3, v3) in v2 {
			println("	  " + k3 + ": " + v3)
		}
	}
}

Error at dotNet:

D:
   C:
          A: System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.String,System.String]]
          B: System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.String,System.String]]

Error at Java:

Listening for transport dt_socket at address: 53147
~> Process started.
!> Exception on thread 0001 () 
!> Type: java.security.PrivilegedActionException 
!> Message: (null) 
An exception occured in test_java, thread 0001 ()
Type: java.security.PrivilegedActionException
Message:
Call Stack:
0000000000000000, , , AccessController.doPrivileged(), (null)
0000000000000000, , URLClassPath.java, URLClassPath$JarLoader.ensureOpen(), (null)
0000000000000000, , URLClassPath.java, URLClassPath$JarLoader.<init>(), (null)
0000000000000000, , URLClassPath.java, URLClassPath$3.run(), (null)
0000000000000000, , URLClassPath.java, URLClassPath$3.run(), (null)
0000000000000000, , , AccessController.doPrivileged(), (null)
0000000000000000, , URLClassPath.java, URLClassPath.getLoader(), (null)
0000000000000000, , URLClassPath.java, URLClassPath.getLoader(), (null)
0000000000000000, , URLClassPath.java, URLClassPath.getNextLoader(), (null)
0000000000000000, , URLClassPath.java, URLClassPath.getResource(), (null)
0000000000000000, , , URLClassLoader$1.run(), (null)
0000000000000000, , , URLClassLoader$1.run(), (null)
0000000000000000, , , AccessController.doPrivileged(), (null)
0000000000000000, , , URLClassLoader.findClass(), (null)
0000000000000000, , , ClassLoader.loadClass(), (null)
0000000000000000, , , ClassLoader.loadClass(), (null)
0000000000000000, , Launcher.java, Launcher$AppClassLoader.loadClass(), (null)
0000000000000000, , , ClassLoader.loadClass(), (null)
0000000000000000, , LauncherHelper.java, LauncherHelper.checkAndLoadMain(), (null)

I’ll check the Java version (only tested .NET); but this was fixed two days ago. The last beta release was friday so the build you have doesn’t have this fix yet.

Confirmed: Java works fine too.

Fixed. Working on both: Java and .Net.

Thank you very much.

Ticket closed.

1 Like