www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - CTFE bug or enhancement?

reply "safety0ff" <safety0ff.dev gmail.com> writes:
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.
Jul 02 2014
parent reply "safety0ff" <safety0ff.dev gmail.com> writes:
Actually, this is an enhancement because adding:
enum b = blah

Makes them fail. :(
Jul 02 2014
parent reply "safety0ff" <safety0ff.dev gmail.com> writes:
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?
Jul 02 2014
parent reply "safety0ff" <safety0ff.dev gmail.com> writes:
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
Jul 02 2014
parent "H. S. Teoh via Digitalmars-d-learn" <digitalmars-d-learn puremagic.com> writes:
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
Jul 03 2014