David Newton wrote:It won't do that unless you enhance the completion code to guess that you're putting in a variable name instead of a type. Just because *you're* expecting it to be able to guess that the variable name isn't actually a type name and you've entered the thing that comes *next* in the token stream... well, I dunno. Why not just just the feature it *does* has, which involves a lot less typing anyway?
Because the principle of least surprise and good interface design means it should behave in the most expected way. Which is as I described. Like if I write:
and CTRL-1 on it, it correctly assumes I want to make a local called a, and offers to fill in the type returned from someMethod(). It doesn't assume that a is a class. So my point is, why is the enhanced for loop not the same? Seems broken.