waneck / testrepo

0 stars 0 forks source link

Issue 1809 - @:overload with fewer args throws not enough args error in Haxe 3.0 RC 2 - haxe #1809

Open waneck opened 11 years ago

waneck commented 11 years ago

[Google Issue #1809 : http://code.google.com/haxe/issues/detail?id=1809] by rjani...@gmail.com, at 2013-05-11T19:08:23.000Z What steps will reproduce the problem?

  1. Create an @:overload function that takes fewer args
  2. Call function with fewer args.

What is the expected output? What do you see instead? Expect program to compile. "Not enough arguments" error during compile.

Please complete the following class with minimal code reproducing the problem :

typedef Foo = { @:overload(function( a : String ) : Void {}) function bar( a : String, b : String ) : Void;
} class Test { static function main() { } static function hobbit( foo : Foo ) : Void { foo.bar("boop");
} }

Please provide any additional information below. This used to work in Haxe 3.0 RC

waneck commented 11 years ago

[comment from si...@haxe.org, published at 2013-05-11T19:12:44.000Z] That doesn't look like something your unit tests should have missed. ;)

waneck commented 11 years ago

[comment from waneck, published at 2013-05-14T01:34:05.000Z] @Simon, I'm looking into this issue, and it seems like this typedef call is being called with "cf" as None, instead of "cf" as Some(TAnon _, field) .

If the @:overload is declared in a class instead of a typedef (e.g. class Foo { @:overload(function(a:String) {}) public static function bar(a:String, b:String):Void {} }

the typer works as expected. Any ideas?

waneck commented 11 years ago

[comment from si...@haxe.org, published at 2013-05-14T07:07:42.000Z] Fixed in r6638. Could you still add a unit test for it?

waneck commented 11 years ago

[comment from si...@haxe.org, published at 2013-05-24T12:02:44.000Z] Caue said he'll still add a unit test tonight, which should be fine. I move it to 3.2 to clean up a bit anyway.