Class overloads work fine (with Bar1). Call site works fine in both cases.
using System;
namespace FooBar;
public static class Program
{
public static void Main()
{
IFoo<int> foo = new Foo<int>();
foo.Bar();
foo.Bar(1);
}
}
public interface IFoo<T>
{
void Bar();
void Bar(int baz);
}
public class Foo<T> : IFoo<T>
{
public void Bar()
{
Console.WriteLine("Bar");
}
public void Bar(int baz)
{
Console.WriteLine("Bar int " + baz);
}
}
Generated Lua:
-- Generated by CSharp.lua Compiler
do
local System = System
local FooBar
local Foo_1Int32
System.import(function (out)
FooBar = out.FooBar
Foo_1Int32 = FooBar.Foo_1(System.Int32)
end)
System.namespace("FooBar", function (namespace)
namespace.class("Program", function (namespace)
local Main
Main = function ()
local foo = Foo_1Int32()
foo:Bar()
foo:Bar1(1)
end
return {
Main = Main
}
end)
namespace.interface("IFoo_1", function ()
return function (T)
return {}
end
end)
namespace.class("Foo_1", function (namespace)
return function (T)
local Bar, Bar
Bar = function (this)
System.Console.WriteLine("Bar")
end
Bar = function (this, baz)
System.Console.WriteLine("Bar int " .. baz)
end
return {
base = function (out)
return {
out.FooBar.IFoo_1(T)
}
end,
Bar = Bar, -- 2 "Bar" implementations instead of a Bar1
Bar = Bar
}
end
end)
end)
end
System.init({
types = {
"FooBar.IFoo_1",
"FooBar.Foo_1",
"FooBar.Program"
}
})
FooBar.Program.Main()
Class overloads work fine (with
Bar1
). Call site works fine in both cases.Generated Lua: