public class Program {
public static void Main() {
var dict = new Dictionary<Id, int>();
dict.Add(new Id("Alice"), 42);
var age = dict[new Id("Alice")];
Console.WriteLine("Alice is " + age);
}
}
record Id(string id);
In regular C# this prints Alice is 42, however, in CSharp.lua:
C:\Tools\lua-5.4.2_Win64_bin\lua.exe: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
stack traceback:
dist/out.lua:8016: in method 'get'
dist/out.lua:19423: in field 'Main'
dist/out.lua:20304: in main chunk
[C]: in ?
make: *** [run] Error 1
Consider the following example:
In regular C# this prints
Alice is 42
, however, in CSharp.lua: