The reason it does this is you might wish to type
get((int)o.hashCode())

admittedly a cast would not be necessary here, but think of the more 
general case
using 2 other classes:


get(B something)
get(int somethingelse)

A inherit = new B(); // where B subclasses A

// then call
get((int)inherit.getSomething())
// versus
get((B)inherit)

Jonas Kvarnstr�m wrote:
> Suppose I have two methods, get(String name) and get(int index).
> 
> I write get(o) where o is an Object, and this is correctly marked as an 
> error.
> 
> Now I want to cast o to String.  I add a parenthesis, "get((|o)", and 
> press ctrl-shift-space.
> 
> IDEA suggests int and String, since it only considers the context where 
> the resulting expression will be used.  Maybe it could also consider the 
> object or primitive value that is being cast to something -- o is an 
> Object and cannot be cast to int.
> 
> 
> 
> _______________________________________________
> Eap-features mailing list
> [EMAIL PROTECTED]
> http://www.intellij.com/mailman/listinfo/eap-features
> 


-- 

Erb

==============================================================
"The only time I like in the morning is afternoon."
     - Russell D. Cooper

"If you do everything, then you're all done."
     - Melissa F. Cooper

"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
     - Larry Wall
==============================================================


_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features

Reply via email to