July 26, 2019 [Issue 20086] New: -betterC and "Unrestricted use of compile-time features" | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20086 Issue ID: 20086 Summary: -betterC and "Unrestricted use of compile-time features" Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: maxhaton@gmail.com -------------Example---------------------------------------------------------- auto demo() //otherfile.d { try { throw new Exception("I am become death"); } catch(Exception e) { return e.msg; } } extern(C) void main() { import otherfile : demo; auto bad = demo(); //This should not compile enum rad = demo(); //This arguably should as per the //(vague) wording of the spec } ------------------------------------------------------------------------------ The specification implies* that arbitrary CTFE should still be possible, regardless of whether said code actually makes it into the resulting executable. * The term "Unrestricted* is not defined, which could make this an enhancement rather than a bug. Either way this behaviour should be possible (Across module boundaries, but in the same file raises the question of whether it should compile or not depend on whether the invalid code is actually used) -- |
Copyright © 1999-2021 by the D Language Foundation