[Issue 7301] New: RegexMatch opCast!bool not working

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 16 19:12:05 PST 2012


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

           Summary: RegexMatch opCast!bool not working
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: jlquinn at optonline.net


--- Comment #0 from Jerry Quinn <jlquinn at optonline.net> 2012-01-16 19:12:04 PST ---
Ubuntu 11.10 x86_64, dmd 2.057

bug2.d contains:

import std.regex;
bool foo() {
  auto re = regex("test");
  return match("test", re);
}

~/dmd2/linux/bin32/dmd -c bug2.d
bug2.d(4): Error: cannot implicitly convert expression (match("test",re)) of
type RegexMatch!(string,ThompsonMatcher) to bool

It works if I use match("test", re).empty

-- 
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