You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect order of operations with increment and array access #473
internalclassProgram{privatestaticvoidMain(string[]args){varids=new[]{0,1,2,3};intj=1;ids[j+1]=ids[j--];Console.WriteLine(string.Join(" ",ids));// should be 0 1 1 3}}
Expected output 0 1 1 3
Actual output: 0 1 2 3
Generated Lua:
-- Generated by CSharp.lua CompilerdolocalSystem=SystemlocalArrayInt32=System.Array(System.Int32)
System.namespace("", function (namespace)
namespace.class("Program", function (namespace)
localMainMain=function (args)
localids=ArrayInt32 { 0, 1, 2, 3 }
localj=1localdefault=jj=default-1-- this should go after the next lineids:set(j+1, ids:get(default))
System.Console.WriteLine(System.String.JoinEnumerable("", ids))
-- should be 0 1 1 3endreturn {
Main=Main
}
end)
end)
endSystem.init({
types= {
"Program"
}
})
Program.Main()
Activity
Separate decrement from array access