Thread overview
[Issue 4744] New: std.conv: string->enum doesn't look for longer match
Aug 28, 2010
Shin Fujishiro
Aug 28, 2010
Shin Fujishiro
Apr 05, 2012
yebblies
May 12, 2012
Kenji Hara
August 28, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4744

           Summary: std.conv: string->enum doesn't look for longer match
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: rsinfu@gmail.com
        ReportedBy: rsinfu@gmail.com


--- Comment #0 from Shin Fujishiro <rsinfu@gmail.com> 2010-08-27 23:04:37 PDT ---
parse!enum(string) must look for a longer match.

--------------------
import std.conv;
unittest
{
    enum E { aa, aaZ, aaaZ }
    assert(to!E("aaaZ") == E.aaaZ);
}
void main() {}
--------------------
% dmd -unittest -run test
std.conv.ConvError: std.conv(684): Can't convert value `Z' of type
const(char)[] to type E

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


Shin Fujishiro <rsinfu@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED


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


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com


--- Comment #1 from yebblies <yebblies@gmail.com> 2012-04-05 10:39:37 EST ---
*** Issue 7821 has been marked as a duplicate of this issue. ***

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


francois.chabot.dev@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |francois.chabot.dev@gmail.c
                   |                            |om


--- Comment #2 from francois.chabot.dev@gmail.com 2012-04-29 20:43:13 PDT ---
possible fix:

https://github.com/D-Programming-Language/phobos/pull/557

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



--- Comment #3 from github-bugzilla@puremagic.com 2012-05-07 20:39:52 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/07d34c1ae0b5283cf5bc22610d4401443549efaf
Fix for BUG 4744, enum parsing will now test every member and select the one
with the longest matching string

https://github.com/D-Programming-Language/phobos/commit/36f5539e0a7315dee8e3613c540584857fc04008 Merge pull request #557 from Chabsf/master

Issue 4744:  std.conv: string->enum doesn't look for longer match

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------