Functions cannot be interpreted while being compiled

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Wed Aug 24 21:39:01 PDT 2016


On 8/24/2016 8:11 PM, ketmar wrote:
> On Thursday, 25 August 2016 at 02:20:31 UTC, Andrei Alexandrescu wrote:
>> Just got the error above. Is this fundamental or an implementation artifact?
>> -- Andrei
>
> fundamental. interpreter operates only on fully semanticed functions, where all
> the analysis, type inferencing and lowering is already complete (otherwise
> interpreter have to reimplement *all* the frontend again, to do exactly same work).
>
> the error mesage you got means that CTFE tried to execute something that is
> still in semantic analysis stage.
>
> this *may* be somewhat relaxed by doing lazy semantic (i.e. only mark something
> for "future analysis", and do real thing when interpreter/compiler really need
> semantic results), but it will require a huge efforts to implement this in
> current FE architecture.
>
> still, this may be some obscure bug in semantic analyser, so it will be good to
> see a minified sample that triggers this.

 From the test suite:

diag8714.d:fail_compilation/diag8714.d(9): Error: function diag8714.foo circular 
dependency. Functions cannot be interpreted while being compiled

fail133.d:fail_compilation/fail133.d(13): Error: function D main circular 
dependency. Functions cannot be interpreted while being compiled



More information about the Digitalmars-d mailing list