jcward / haxe-overload

Haxe macro library to support overloaded functions.
MIT License
18 stars 1 forks source link

why only support static method? #11

Open sonygod opened 5 years ago

sonygod commented 5 years ago

why only support static method?

jcward commented 5 years ago

Well, the original idea behind this library was to introduce overloaded functions via static extension, which allows you to add this functionality to core types, like String.

As such, this macro works on static tools classes, and to transform the call sites, it checks the "using" statements of all compiled classes to detect when the expression transform should be invoked. It kind of limits the overall impact of this macro (performance, complexity) on an existing codebase.

It could be possible to explore other methods of overloading.