[Issue 2303] static assert in a template function is not reported

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 22 01:01:55 PDT 2008


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





------- Comment #1 from samukha at voliacable.com  2008-08-22 03:01 -------
A corrected example:

----
struct S(T)
{
}

void foo(T : S!(U), U)(invariant(U) u)
{
    T s;
    bar!(T)(s, u);
}

void bar(T : S!(U), U)(T s, invariant(U) u)
{
    static assert(false, "Error!");
}

void main()
{
    foo!(S!(int))(1);
}
----

Works as expected if invariant type modifiers are omitted.


-- 



More information about the Digitalmars-d-bugs mailing list