Closed GoogleCodeExporter closed 9 years ago
Operator overloading and numeric promotion is implemented via add proxy
function to symbol table.
We need to add buildin operators as function prototypes to symbol table for
overloading.
Original comment by wuye9036
on 8 Oct 2010 at 7:30
The main code of overloading was finished. but an important problem exists yet.
It is appear in numeric promotion.
Consider that, S is the type of evaluating function, and D is the type of evaluated function, and T is the real type of argument expression. The current algorithm is, is S to D has an implicit conversation, and D could not be converted to S implicitly, S is the better conversation.
It could works well in most cases. But sometimes, It is too strictly for user.
Consider following case:
byte b;
void foo( ulong v );
void foo( int v );
now, we call foo as:
foo(b);
Reasonable, "foo" will be overloaded as "foo( ulong )".
But in our method, since ulong could not convert to int and vice versa, a ambigous error would be reported.
So we need more rules to processing these cases yet.
Hi, Ming, Could you work on it ? Rules you can find in C# specification, about in section overloading & numeric promotion. Thank you.
Original comment by wuye9036
on 10 Oct 2010 at 4:01
Original comment by wuye9036
on 15 Dec 2010 at 5:07
Original comment by wuye9036
on 7 Mar 2012 at 2:58
Original issue reported on code.google.com by
wuye9036
on 25 Sep 2010 at 10:32