Thread overview
CTFE bug or enhancement?
Jul 03, 2014
safety0ff
Jul 03, 2014
safety0ff
Jul 03, 2014
safety0ff
Jul 03, 2014
safety0ff
Jul 03, 2014
H. S. Teoh
July 03, 2014
Everything compiles fine except for function qux2:
http://dpaste.dzfl.pl/9d9187e0b450

Is this a bug or an enhancement for CTFE?

It would be really nice to have this feature because core.simd has functions such as: void16 __simd(XMM opcode, void16 op1, void16 op2, ubyte imm8);

Where all the arguments must be compile time constants.

It would be nice to be able to push some parameters out from the type list and into the argument list in user code too.
July 03, 2014
Actually, this is an enhancement because adding:
enum b = blah

Makes them fail. :(
July 03, 2014
On Thursday, 3 July 2014 at 01:55:14 UTC, safety0ff wrote:
> Actually, this is an enhancement because adding:
> enum b = blah
>
> Makes them fail. :(

The question is now: how can the delegate be evaluated for the return value but not for the enum?
July 03, 2014
On Thursday, 3 July 2014 at 02:02:19 UTC, safety0ff wrote:
> On Thursday, 3 July 2014 at 01:55:14 UTC, safety0ff wrote:
>> Actually, this is an enhancement because adding:
>> enum b = blah
>>
>> Makes them fail. :(
>
> The question is now: how can the delegate be evaluated for the return value but not for the enum?

Looks like an ICE: https://github.com/D-Programming-Language/dmd/blob/master/src/interpret.c#L5169
July 03, 2014
On Thu, Jul 03, 2014 at 02:09:09AM +0000, safety0ff via Digitalmars-d-learn wrote:
> On Thursday, 3 July 2014 at 02:02:19 UTC, safety0ff wrote:
> >On Thursday, 3 July 2014 at 01:55:14 UTC, safety0ff wrote:
> >>Actually, this is an enhancement because adding:
> >>enum b = blah
> >>
> >>Makes them fail. :(
> >
> >The question is now: how can the delegate be evaluated for the return value but not for the enum?
> 
> Looks like an ICE: https://github.com/D-Programming-Language/dmd/blob/master/src/interpret.c#L5169

All ICE's are bugs and should be reported as such.


T

-- 
If the comments and the code disagree, it's likely that *both* are wrong. -- Christopher