Skip to content

[cs] Default params in haxe dll used from cs #4147

@azrafe7

Description

@azrafe7

Having troubles using this class (compiled as a .net 40 dll) from cs:

class IntPoint {

    public var x:Int;
    public var y:Int;

    public function new(x:Int = 0, y:Int = 0) {
        this.x = x;
        this.y = y;
    }
}

In CS I get:

...
namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            IntPoint ip0 = new IntPoint();               // 'IntPoint' does not contain a constructor that takes 0 arguments
            IntPoint ip1 = new IntPoint(0, 0);           // cannot convert from 'int' to 'haxe.lang.Null<int>'
            IntPoint ip2 = new IntPoint((int)0, (int)0); // cannot convert from 'int' to 'haxe.lang.Null<int>'
        }
    }
}

Am I doing something wrong?

I'm using latest haxe nightly (3.2.0 (git build development @ ec44565)), and git hxcs (also tried with the haxelib ver), compiling with VS Express 2010.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions