http://d.puremagic.com/issues/show_bug.cgi?id=8400


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugd...@yahoo.com.au


--- Comment #4 from Don <clugd...@yahoo.com.au> 2012-07-25 03:39:21 PDT ---
(In reply to comment #3)
> > void main(){
> >     immutable a = [1,2];
> >     int[a.length+0] b; // ok
> >     int[a.length  ] c; // error
> > }
> > 
> > The code should compile.
> 
> That code should not compile, in my opinion.

The rule is, in any circumstance where a compile-time value is required, it
will attempt to interpret it at compile time. If it fails, it is an error.

> Nor this one:
> 
> immutable a = [1, 2];
> void main() {
>     int[a.length] b;
> }

No, that should *definitely* compile.

Global variables with initializers always have the initializer CTFE'd.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to