https://issues.dlang.org/show_bug.cgi?id=13010
--- Comment #3 from Lionello Lunesu <[email protected]> --- (In reply to Kenji Hara from comment #2) > (In reply to Lionello Lunesu from comment #0) > > This code should work: > > > > void testvrp(ubyte l) > > { > > immutable int i = l; > > static assert(i + 1); > > } > > To me the code looks very weird, because: > > 1. static assert condition is *always* evaluated in compile time. > 2. but the expression i + 1 cannot be evaluated at compile time. > > These items are contradict each other, so I think it should not be compiled. > > Could you please show me an *actual* use case of this enhancement? How do you feel about it when the code is changed to this: void testvrp(ubyte l) { immutable int i = l; static assert(i >= 0); } --
