4 ms·
>In `7`. It's an `int` literal, so `x` has to be an `int` What is that other than inferring the type of x from the type of 7? Edit: You don't need to convince
by fauigerzigerk 11y ago
>In `7`. It's an `int` literal, so `x` has to be an `int`
What is that other than inferring the type of x from the type of 7?
Edit: You don't need to convince me that this is extremely primitive type inference. I'm not defending the quality of C++ or Go type inference at all.
- sklogic 11y agoThe point is that this is not a type inference, it is a restricted form of a type propagation (i.e., a subset of the pre-auto C++ type propagation, not an extension of it).
- fauigerzigerk 11y agoSo your point is that some people do not consider every form of inferring the type of a variable to be type inference. I get that.
- sklogic 11y agoNo, I am pointing out that the type is fully explicit here and not "inferred" from anything.