http://d.puremagic.com/issues/show_bug.cgi?id=5906
yebblies yebbl...@gmail.com changed:
What|Removed |Added
CC||yebbl...@gmail.com
---
http://d.puremagic.com/issues/show_bug.cgi?id=5906
--- Comment #8 from bearophile_h...@eml.cc 2013-03-07 12:15:52 PST ---
(In reply to comment #7)
This can be done by converting precondition bodies to expressions then
const-folding them. Non-trivial, but possible.
Thank you for the note,
http://d.puremagic.com/issues/show_bug.cgi?id=5906
--- Comment #9 from yebblies yebbl...@gmail.com 2013-03-08 13:33:42 EST ---
(In reply to comment #8)
(In reply to comment #7)
This can be done by converting precondition bodies to expressions then
const-folding them. Non-trivial, but
http://d.puremagic.com/issues/show_bug.cgi?id=5906
--- Comment #11 from bearophile_h...@eml.cc 2013-03-07 19:29:40 PST ---
(In reply to comment #10)
If the pre-condition analysis (constant folding) is done after a normal step
of
dead branch removal, then maybe that error will not be shown.
http://d.puremagic.com/issues/show_bug.cgi?id=5906
--- Comment #10 from bearophile_h...@eml.cc 2013-03-07 19:25:12 PST ---
(In reply to comment #9)
struct S(int a)
{
void fun(int b) in { assert(a != b); } body {}
}
void main()
{
foreach(i; TypeTuple!(1, 2, 3, 4))
{
http://d.puremagic.com/issues/show_bug.cgi?id=5906
--- Comment #12 from yebblies yebbl...@gmail.com 2013-03-08 14:33:58 EST ---
(In reply to comment #10)
I see, thank you for the answer.
If the pre-condition analysis (constant folding) is done after a normal step
of
dead branch removal,
http://d.puremagic.com/issues/show_bug.cgi?id=5906
--- Comment #6 from bearophile_h...@eml.cc 2013-02-27 15:56:31 PST ---
(In reply to comment #4)
But if I write code like this:
void main(string[] args) {
byte x = args.length;
}
It does not perform that test at compile-time,
http://d.puremagic.com/issues/show_bug.cgi?id=5906
Walter Bright bugzi...@digitalmars.com changed:
What|Removed |Added
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=5906
bearophile_h...@eml.cc changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|
http://d.puremagic.com/issues/show_bug.cgi?id=5906
--- Comment #4 from bearophile_h...@eml.cc 2012-12-25 03:42:02 PST ---
If I write:
void main() {
byte x = 200;
}
The compiler refuses that code statically, it means it performs a run-time test
of the value:
test.d(2): Error: cannot
http://d.puremagic.com/issues/show_bug.cgi?id=5906
--- Comment #5 from bearophile_h...@eml.cc 2012-12-25 03:42:49 PST ---
(In reply to comment #4)
The compiler refuses that code statically, it means it performs a run-time
test
of the value:
Sorry, I meant a compile-time test.
--
11 matches
Mail list logo