Can someone explain why this is not an error?
dolive
dolive89 at sina.com
Thu Jul 1 03:26:34 PDT 2010
Bernard Helyer дµ½:
> http://www.digitalmars.com/d/2.0/declaration.html
>
> "In a declaration declaring multiple symbols, all the declarations must
> be of the same type:"
>
> Yet this compiles:
>
> ---
> void main()
> {
> immutable a = 3, b = 4.2, c = true;
> }
> ---
>
> a, b, and c all have different types. Unless you consider the type as
> 'type to be inferred'. Can anyone explain this behaviour to me?
>
immutable int a = 3, b = 4.2, c = true; // is error
More information about the Digitalmars-d
mailing list