fjgandrade / sharpkit

Automatically exported from code.google.com/p/sharpkit
0 stars 0 forks source link

Consistent method overloads #362

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
[assembly: JsType(Mode = JsMode.Clr, Filename = "res/Default.js")]

public interface IDrivable
{
    void Drive(float speed);
}

public class Car : IDrivable
{
    public void Drive(float speed)
    {
    }

    public void Drive(float speed, bool forward)
    {
    }
}

IDrivable drivable = new Car();
drivable.Drive(50);

This throws an js error because the interface doesn't have the suffix in  the 
method name in js.
Is there a way to force all overloads with the parameters suffix?

Original issue reported on code.google.com by mvdbur...@gmail.com on 22 Aug 2014 at 8:14

GoogleCodeExporter commented 9 years ago
Support:
[JsMethod(ForceMethodSuffix=true)]
[JsType(ForceMethodSuffix=true)]

And in assembly level, as default jstype attribute:
[assembly: JsType(ForceMethodSuffix=true)]

Original comment by DanelK...@gmail.com on 26 Aug 2014 at 8:35

GoogleCodeExporter commented 9 years ago

Original comment by sebastia...@gmail.com on 4 Sep 2014 at 2:02