[Issue 19268] BetterC turns off DRuntime for CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 26 23:13:38 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=19268

--- Comment #11 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to ZombineDev from comment #5)
> I guess the trickiest problem to solve is what to do about is(typeof({ code;
> })) and __traits(compiles, { code; }). Allowing those constructs to yield
> true while containing non-betterc code would lead to logical contradictions.
> Disallowing betterc code in such speculative contexts, while allowing it in
> CTFE context would be strange.

When trying to test stuff surrounding this, I'll note that a betterC error
seems to kill the compilation when used inside __traits(compiles).

This prints nothing and produces no binary:

extern(C) void main()
{
   int[] arr;
   pragma(msg, __traits(compiles, arr.idup));
}

--


More information about the Digitalmars-d-bugs mailing list