Re: how to propagate computed type during CTFE?

2018-02-23 Thread Stefan Koch via Digitalmars-d
On Friday, 23 February 2018 at 00:54:34 UTC, Timothee Cour wrote: in example below, how do I propagate RET (or even `typeof(a)`) to the result value of `inferType`? does this need a language change to allow this? ``` template inference(alias emitter) { auto inference(){ auto

Re: how to propagate computed type during CTFE?

2018-02-22 Thread Simen Kjærås via Digitalmars-d
On Friday, 23 February 2018 at 00:54:34 UTC, Timothee Cour wrote: in example below, how do I propagate RET (or even `typeof(a)`) to the result value of `inferType`? does this need a language change to allow this? No can do. Consider what would happen if you added put(1); inside fun - what

Re: how to propagate computed type during CTFE?

2018-02-22 Thread rikki cattermole via Digitalmars-d
On 23/02/2018 1:54 PM, Timothee Cour wrote: in example below, how do I propagate RET (or even `typeof(a)`) to the result value of `inferType`? does this need a language change to allow this? ``` template inference(alias emitter) { auto inference(){ auto inferType(){

how to propagate computed type during CTFE?

2018-02-22 Thread Timothee Cour via Digitalmars-d
in example below, how do I propagate RET (or even `typeof(a)`) to the result value of `inferType`? does this need a language change to allow this? ``` template inference(alias emitter) { auto inference(){ auto inferType(){ emitter!((a){ enum RET=typeof(a).stringof; // type