View mode: basic / threaded / horizontal-split · Log in · Help
January 03, 2013
[Issue 9263] New: statement is not reachable when statement is reachable
http://d.puremagic.com/issues/show_bug.cgi?id=9263

          Summary: statement is not reachable when statement is reachable
          Product: D
          Version: D2
         Platform: All
       OS/Version: All
           Status: NEW
         Severity: regression
         Priority: P2
        Component: DMD
       AssignedTo: nobody@puremagic.com
       ReportedBy: deadalnix@gmail.com


--- Comment #0 from deadalnix <deadalnix@gmail.com> 2013-01-03 03:36:22 PST ---
enum E : uint
{
   A,
   B,
}

private string foobar(E e)
{
   final switch (e) with (E) {
   case A:
       return "A";
   case B:
       return "B";
   }
}

The final switch is not reachable according to dmd.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 03, 2013
[Issue 9263] statement is not reachable when statement is reachable
http://d.puremagic.com/issues/show_bug.cgi?id=9263


bearophile_hugs@eml.cc changed:

          What    |Removed                     |Added
----------------------------------------------------------------------------
                CC|                            |bearophile_hugs@eml.cc


--- Comment #1 from bearophile_hugs@eml.cc 2013-01-03 04:09:39 PST ---
A bit simplified. string, final, uint are not needed to show the problem:


enum Foo { A }
int main() {
   Foo f;
   final switch(f) with(Foo) {
       case A:
           return 0;
   }
}


The with() statement has some problems.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 03, 2013
[Issue 9263] statement is not reachable when statement is reachable
http://d.puremagic.com/issues/show_bug.cgi?id=9263


Kenji Hara <k.hara.pg@gmail.com> changed:

          What    |Removed                     |Added
----------------------------------------------------------------------------
          Keywords|                            |pull, rejects-valid


--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2013-01-03 07:35:56 PST ---
https://github.com/D-Programming-Language/dmd/pull/1431

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 03, 2013
[Issue 9263] statement is not reachable when statement is reachable
http://d.puremagic.com/issues/show_bug.cgi?id=9263



--- Comment #3 from github-bugzilla@puremagic.com 2013-01-03 11:09:47 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/9e58954f0303064d4aa413011085ce838d00f993
fix Issue 9263 - statement is not reachable when statement is reachable

https://github.com/D-Programming-Language/dmd/commit/539b54ac7c423f53966384bd572ec4db10c6da0e
Merge pull request #1431 from 9rnsr/fix9263

Issue 9263 - statement is not reachable when statement is reachable

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 04, 2013
[Issue 9263] statement is not reachable when statement is reachable
http://d.puremagic.com/issues/show_bug.cgi?id=9263


Walter Bright <bugzilla@digitalmars.com> changed:

          What    |Removed                     |Added
----------------------------------------------------------------------------
            Status|NEW                         |RESOLVED
                CC|                            |bugzilla@digitalmars.com
        Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Top | Discussion index | About this forum | D home