RE: Method overloading work-around: the problems & possible solution

2012-01-17 Thread David Arno
> From: Web DoubleFx [mailto:webdoubl...@hotmail.com] > Sent: 16 January 2012 22:59 > > Type inference as been implemented in Falcon. > http://blogs.adobe.com/avikchaudhuri/2011/01/19/setting-the-context/  > > And for the ambiguous types, any method that supports it can be called. That's brilli

RE: Method overloading work-around: the problems & possible solution

2012-01-16 Thread Web DoubleFx
> From: da...@davidarno.org >  > We put in place a catch-all foo that handles all the situations where the > compiler cannot work out the mapping at compile time. >  > Thoughts? >  > David. >  "type inference should be able to figure out what method signature is being targeted, and whether the

Re: Method overloading work-around: the problems & possible solution

2012-01-16 Thread Alex Harui
On 1/16/12 9:30 AM, "David Arno" wrote: > class TestAB > { > public function testFoo():void > { > var ab:AB = new AB(); > ab.foo(1); // <- which foo does this call? int, uint or Number? > ab.foo(null); // <- and this one? String or Object? > ab["foo"]("");

Re: Method overloading work-around: the problems & possible solution

2012-01-16 Thread Jeffry Houser
On 1/16/2012 12:30 PM, David Arno wrote: Now imagine we have a modified version of the compiler that supports method overloading. AB compiles to: class AB -> foo_String_void -> String -> void -> {} foo_int_void -> int -> void -> {} foo_uint_void -> uint -> void -> {} foo_Numb

RE: Method overloading work-around: the problems & possible solution

2012-01-16 Thread Web DoubleFx
> From: da...@davidarno.org > To: flex-dev@incubator.apache.org > Subject: Method overloading work-around: the problems & possible solution > Date: Mon, 16 Jan 2012 17:30:09 + > > Consider the following code example: > > interface IA > { > function foo(

Re: Method overloading work-around: the problems & possible solution

2012-01-16 Thread Martin Heidegger
On 17/01/2012 02:41, Martin Heidegger wrote: This could also apply to foo(uint(1)); sorry :) Martin.

Re: Method overloading work-around: the problems & possible solution

2012-01-16 Thread Martin Heidegger
On 17/01/2012 02:30, David Arno wrote: ab.foo(1); //<- which foo does this call? int, uint or Number? Right now all integer numbers are treated as regular integers (avm doesn't support uint properly). This means that 1 will be an integer and therefore foo(i:int) would be used. "1.0