-
Notifications
You must be signed in to change notification settings - Fork 205
Closed
Description
I'm having issues running code which contains a using statement inside a for loop, which contains a break.
public static void WhileUsingContinue() {
LinkedList<int> list = new LinkedList<int>();
for (int i = 0; i < 15; i++) {
using (LinkedList<int>.Enumerator em = list.GetEnumerator()) {
if (i == 13)
{
break;
}
}
Console.WriteLine("Iteration: {0}", i);
}
}
Converting this code using CSharp.lua gives this lua code
WhileUsingContinue = function ()
local list = LinkedListInt32()
for i = 0, 14 do
System.using(list:GetEnumerator(), function (em)
if i == 13 then
break
end
end)
System.Console.WriteLine("Iteration: {0}", i)
end
end
The lua interpreter is not able to run this code
lua5.3: error loading module 'out.Tests.TestVector' from file './out/Tests/TestVector.lua':
./out/Tests/TestVector.lua:73: <break> at line 71 not inside a loop
Metadata
Metadata
Assignees
Labels
No labels