February 05, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5713



--- Comment #9 from bearophile_hugs@eml.cc 2012-02-05 06:59:27 PST ---
Turning bugs into enhancement requests is a good way to reduce bug count, but it doesn't address the problems.

"enhancement" sounds like something that someone wants to add, like switching on structs. But this is not the case. Given a sane definition of final switch, asking the compiler to refuse code like this at compile-time is not an enhancement:


void main() {
    int x = 100;
    final switch (x % 3) {
        case 0: break;
        case 1: break;
    }
}


Then maybe we need a "wrong_specs" tag in Bugzilla, for the situations where the compiler is working as the spec say, but where the spec themselves look wrong.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 05, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5713


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies@gmail.com


--- Comment #10 from yebblies <yebblies@gmail.com> 2012-02-06 02:38:35 EST ---
(In reply to comment #9)
> Then maybe we need a "wrong_specs" tag in Bugzilla, for the situations where the compiler is working as the spec say, but where the spec themselves look wrong.

The problem with this is that it is completely subjective.  The line between 'I wish D had this' and 'It is a design error that D doesn't have this' varies from person to person, and without hard rules having a keyword to distinguish between them is useless.

I don't have a solution for this, but the people fixing bugs and implementing features are well aware that enhancement means 'not a priority' not 'won't happen'.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 31, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5713


Rene <reneduani@yahoo.com.br> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reneduani@yahoo.com.br


--- Comment #11 from Rene <reneduani@yahoo.com.br> 2012-08-31 09:48:27 PDT ---
Ok, this change broke my code that I wrote *following the spec*. And it only breaks on runtime! The fix was simple (adding a case 0: break;), but still the spec needs to be updated if you guys are changing it.

And breaking changes that don't give compiler errors on now-wrong-code are quite nasty...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 24, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5713


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |major


--- Comment #12 from bearophile_hugs@eml.cc 2012-12-23 22:57:35 PST ---
This issue was definitively mislabelled, this is clearly a bug, and even significant. Bumped to major.



void main() {
    bool b;
    final switch (b) {
        case true:
            break;
    }
}

It compiles without errors.

At runtime gives:


core.exception.SwitchError@test(3): No appropriate switch clause found

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 26, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5713



--- Comment #13 from bearophile_hugs@eml.cc 2012-12-26 04:13:35 PST ---
See also this thread: http://forum.dlang.org/thread/hoczugrnzfbtvpnwjevd@forum.dlang.org


I think this code should be supported, because here the compiler is able to statically enforce that every possible ushort value is covered by exactly one of the final switch cases:


void main () {
    ushort x;
    final switch (x) {
        case 0: .. case 1000:
            break;
        case 1001: .. case ushort.max:
            break;
    }
}


See also issue 5714

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2
Next ›   Last »