PROPOSAL: Method and Field Literals
Rémi Forax
forax at univ-mlv.fr
Thu Mar 12 14:57:22 PDT 2009
Neal Gafter a écrit :
> On Thu, Mar 12, 2009 at 1:55 PM, Rémi Forax <forax at univ-mlv.fr> wrote:
>
>> Neal,
>> I don't know if you will regret saying this but
>> I will regret to not saying that it will create lot of puzzlers like this
>> one:
>>
>> class A {
>> static int f(int) { ... }
>> }
>> ...
>> {int => int} c=A#f(int);
>> A#f(int).equals(c) // false because A#f(int) is a
>> java.lang.reflect.Method
>>
>
> It's hard for me to imagine how to turn this into a "real" puzzler
> rather than just a curiosity. How do you imagine a programmer could
> get "bitten" by this?
>
Come on, implicit conversion rules always creates a mismatch between
what the compiler does
and what the developer think.
Here, I just alias an expression, why the result is not true.
Rémi
More information about the coin-dev
mailing list