Additional (and inconsequential) restriction on implicit typing
Chapter 8: Cutting fluff with a smart compiler: 8.2.2
Last updated: 3/3/2008
The following method call and assignment is legal. Insane, but legal.
int j = M(j=10);
It has the semantics of this code:
temp = (j = 10);
j = M(temp);
Okay, fair enough - hopefully most readers know that code like this is a recipe for disaster. However, let's try adding implicit typing to the mix:
var j = M(j=10);
How do we find out the type of
j? We look at the return type of
How do we work out which overload of
M so use? We look at the type of
In short, there's a chicken and egg problem, so this is declared to be illegal.