[Issue 8750] New: ICE when using any and all as a template condition

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 3 21:28:37 PDT 2012


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

           Summary: ICE when using any and all as a template condition
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: daniel350 at bigpond.com


--- Comment #0 from Daniel Cousens <daniel350 at bigpond.com> 2012-10-03 21:22:41 PDT ---
import std.stdio : writeln;
import std.algorithm : any, all, countUntil, canFind;

struct mystruct {
    int a, b;
}

int myfunc(string sw, R ...)(mystruct v) if (all!(x => any!(y => x ==
y)(R))(sw)) { // FIXME: Breaks DMD
    return mixin("v." ~ sw[0] ~ "+ v." ~ sw[1]); 
}

void main() {
    mystruct z = {3, 4};

    writeln(myfunc!("aa", 'a', 'b')(z));
}

DPaste: http://dpaste.dzfl.pl/fe062cd3

ICE: dmd: mangle.c:81: char* mangle(Declaration*): Assertion `fd &&
fd->inferRetType' failed.

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