[Issue 7091] ICE in Statement::blockExit

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 10 11:52:22 PST 2011


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



--- Comment #1 from Trass3r <mrmocool at gmx.de> 2011-12-10 11:52:22 PST ---
more valid case:

struct Matrix(T)
{
    @property T[] data() { return null; }

    int opApply(scope int delegate(ref size_t[], ref T) dg) { return 0; }
    int opApply(scope int delegate(ref const(size_t[]), ref const(T)) dg) const
{ return 0; }

    Matrix!(typeof(mixin("data[0] " ~ op ~ " data[0]"))) opBinary(string
op)(Matrix other)
    {
        auto result = typeof(return)();
        foreach (i, ref val; this)
        { mixin("result[i] = val " ~ op ~ " other[i];"); }
        return result;
    }
}

void main() { auto m = Matrix!size_t(); m = m * m; }


$ dmd -c test2.d 
test2.d(11): Error: cannot uniquely infer foreach argument types
Statement::blockExit(0x1c509c0)
mixin("result[i] = val " ~ op ~ " other[i];");

dmd: statement.c:144: virtual int Statement::blockExit(bool): Assertion `0'
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