Pelle Månsson <[email protected]> wrote:
'auto' is not a placeholder for a type, but the default storage class. IOW, 'int n;' == 'auto int n;'. This does however not compile, complaining that it has no effect. Specifying just the storage class signals the compiler to use type inference. Try it: const x = 4; immutable y = 4;I'm not sure you are correct: const static auto x = 4;
I don't see how this contradicts anything I've said. You can safely remove auto from that statement, and the type will be inferred to the same. The fact that it compiles is a compiler bug, if we take the error message in the 'auto int x;' example to be representative. -- Simen
