Fire/Silver don't iterate over some structures

I was finishing to develop some libraries to .Net with Fire/Silver, but I found a big problem that can make all my work go to trash. The compiler give an error, described below, while I try to iterate over the structure below. It works fine at Xcode. Follow the test code:

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 (k1, v1) in L1 {
	print(k1 + ":")
	for (k2, v2) in v1 {
		print("   " + k2 + ":")
		for (k3, v3) in v2 {
			print("      " + k3 + ": " + v3)
		}
	}
}

The compiler doesn’t recognize v2 like a Dictionary. Then the last “for” fail.
Xcode correctly run and print it:

D:
   C:
      B: 2
      A: 1

But at Fire I get the message:

Type “Object!” has no default property to use for array accessors.

As this structure [String: [String: [String: String]]]() is essencial to the main class of my framework, I really need to iterate over it. Then, please, help me.
Thank you very much.

Looks like a compiler bug. Shows for something as simple as

var X1 = [String:String]()
for (a,b) in X1 {} // E189 Type "Object!" has no default property to use for array accessors

No worries, we’ll make sure this gets addressed.

Thanks, logged as bugs://73153

I am needing only it to finish the framework.
Do you have in mind how many time to fix this?
Thank you very much for support.

I can’t say, but i’ve given the issue top prio.

Thanks

bugs://73153 got closed with status fixed.

Apparently, it is not working al all cases.
The first two cases below will print correctly, but the third not.

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)
		}
	}
}

Will print:

Process started.
A: 1
B: 2

C: 
   A:1
   B:2

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]]
Process test_app terminated with exit code 0

All cases should print:

A: 1
B: 2

bugs://73153 got reopened.

Does this issue still show for you>?

Yes, the same error.
I tested at the latest version of Fire 8.3.93.1987 built on 20160503-115736 and it is still doing the same.

I am using Mono as target.
When I use Java as target shows the message below:

Listening for transport dt_socket at address: 55756
Process started.
Exception on thread 0001 ()
Type: java.security.PrivilegedActionException
Message: (null)

Which is it? The original issue, or this exception?

The error is showed below:

Process started.
A: 1
B: 2

C:
A:1
B:2

D:
C:
A: System.Collections.Generic.Dictionary2[System.String,System.Collections.Generic.Dictionary2[System.String,System.String]]
B: System.Collections.Generic.Dictionary2[System.String,System.Collections.Generic.Dictionary2[System.String,System.String]]
Process test_app terminated with exit code 0

This error is showed when the target is Mono.
When I target Java shows:

Listening for transport dt_socket at address: 55756
Process started.
Exception on thread 0001 ()
Type: java.security.PrivilegedActionException
Message: (null)

Hi Mark, almost a year passed and this bug are still opened.
Do you have an idea if you will correct it and when?
I really would like to use Fire as my main IDE but this bug is avoiding it because the compiler can’t recover the object stored.
Best regards,
Fernando

The issue is set to high priority and for the upcoming 8.4 release. I’ll make sure it does get looked at, my apologies.

Thank you for attention, Mark.
I will be waiting the next release with affection and expectation.
Best regards,
Fernando

Hi Marc,

I decided to test Oxygene to the same bug and did a program for Oxygene for .Net and got a compiler error saying Type is not enumerable for v3 and v2 variables. The error is showed to the last for each code lines.

I don’t know if both bugs are related but as I used the same code to test Oxygene and Swift, I decided say it here. The difference is that in swift the error occur at runtime while in Oxygene the error occur at compile time.

As you can see v3 should had type inferred as Dictionary< String, Dictionary< String, String>> and v2 had type inferred as Dictionary< String, String>.

Thank you for your attention.

Follow the code:

namespace test_fire;
interface
uses
  System.Linq,
  System.Collections.Generic;
type
  Program = class
  public
    class method Main(args: array of String): Int32;
  end;
implementation
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 index k2 do begin
      writeLn("   " + k2 + ":");
      for each v1 in v2 index k1 do begin
        writeLn("    " + k3 + ": " + v3);
      end;
    end;
  end;
end;
end.

Sorry, I forgot to say that I used Fire version 8.3.93.1987 to test this code.
Thanks.

Correcting my code. Last writeLn is wrong. Should be:

  for each v3 in L3 index k3 do begin
    writeLn(k3 + ":");
    for each v2 in v3 index k2 do begin
      writeLn("   " + k2 + ":");
      for each v1 in v2 index k1 do begin
        writeLn("    " + k1 + ": " + v1);
      end;
    end;
  end;