Comment #0 by kamm-removethis — 2008-12-20T04:00:50Z
This compiles and fails the assert:
template T() { const o = new Object; }
void main() { assert(T!().o is T!().o); }
It should not compile, as
const o = new Object;
also fails with "Error: non-constant expression new Object".
The assert is triggered because DMD emits a call to new for each mention of T!().o inside a function.
Comment #1 by yebblies — 2012-01-29T22:22:56Z
D2 bug is duplicate of issue 2414.
Comment #2 by yebblies — 2012-01-29T22:23:06Z
*** Issue 2706 has been marked as a duplicate of this issue. ***
Comment #3 by yebblies — 2012-02-01T20:32:19Z
*** Issue 4397 has been marked as a duplicate of this issue. ***
Comment #4 by pro.mathias.lang — 2019-05-11T17:01:40Z