[Issue 7909] to!(enum)(string) and to!(string)(enum) break when enum is integral

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 14 07:56:22 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7909



--- Comment #2 from Adam D. Ruppe <destructionator at gmail.com> 2012-04-14 07:57:10 PDT ---
Well, a simple enough fix for the first one is to tighten up the constraint on
toImpl for the isIntegral one.

Line 1156 of conv.d, add: !is(S == enum).

Doesn't seem to break anything (indeed, if isIntegral used to always return
false on enums, it'd just be restoring the previous behavior anyway).



Now, for the parsing side. We can do basically the same thing.

Line 1708 of conv.d, add: && !is(Target == enum).

That takes the isIntegral variety out of consideration, and then
it uses the correct enum version.

Strange that it didn't say "matches more than one" again, since
it is basically the same thing, but meh, whatever, this fixes it
and didn't break the other cases I tried.

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


More information about the Digitalmars-d-bugs mailing list