dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]ECMA doubt .. function overloading


From: Gopal V
Subject: Re: [DotGNU]ECMA doubt .. function overloading
Date: Sat, 9 Nov 2002 00:07:28 +0530
User-agent: Mutt/1.2.5i

If memory serves me right, Adam Treat wrote:
> either cscc is wrong or everyone else is.

IMHO .. every one else is wrong ... (and that saves me a lot of work too ;)

If this works the way I think it should,it should give 'Parent' since that 
is the nearest matching signature member of 'Child' viz "V(vSystem.Int32;)".
Otherwise it violates the entire OO concept of function overloading &
inhertiance !!

Ecma Spec: 14.4.2
"""
    given the set of applicable candidate function members, the best 
        function member in that set is located. If the set contains only 
        one function member, then that function member is the best function 
        member. Otherwise, the best function member is the one function 
        member that is better than all other function members with respect 
        to the given argument list, provided that each function member is 
        compared to all other function members using the rules in ยง14.4.2.2. 
        If there is not exactly one function member that is better than all 
        other function members, then the function member invocation is 
        ambiguous and a compile-time error occurs.
"""

Conversion from Int->Float is implicit while , Float->Int is explicit...
So by ECMA (14.4.2.3) the first is the preferred function argument ... 

Where the HELL do they specify the ordering of classes in lookup ?..

Still waiting for Rhys to respond,
Gopal
-- 
The difference between insanity and genius is measured by success


reply via email to

[Prev in Thread] Current Thread [Next in Thread]