Type inference in Eiffel?
I'm not really happy with the signature of infix "+" in class NUMERIC. It seems to me that it tells a lie with its like Currents. I understand that the story is that this should be interpreted with respect to the converted object, and not to the text that appears in the program, but it is this that makes me unhappy.
It would be nice to talk about type inference instead. For instance, in the code below, rather than say that the type of the literal 7 is INTEGER_32 (and therefore that the type of the second operand to the addition should also be INTEGER_32, and an INTEGER_32 result should be produced, and then having to talk about the temporary converted object to spin the story), it would be nicer to say that the compiler is inferring that the type of the literal 7 has to be REAL_64. This seems reasonable. :-)
But what about the code below? Can one really claim type inference to REAL_64 when the programmer has explicitly requested INTEGER_8?
I am unhappy again. :-(