www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4744] New: std.conv: string->enum doesn't look for longer match

reply d-bugmail puremagic.com writes:
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



---
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: -------
Aug 27 2010
next sibling parent d-bugmail puremagic.com writes:
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: -------
Aug 27 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4744


yebblies <yebblies gmail.com> changed:

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



*** 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: -------
Apr 04 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
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



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: -------
Apr 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4744




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


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 07 2012
prev sibling parent d-bugmail puremagic.com writes:
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: -------
May 12 2012