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


Kenji Hara <k.hara...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
                 CC|                            |k.hara...@gmail.com
            Version|2.036                       |D2


--- Comment #1 from Kenji Hara <k.hara...@gmail.com> 2011-04-18 20:20:18 PDT ---
More comprehensive code.
----
struct S
{
    int v;
    this(int n) { v = n; }
    const bool opCast(T:bool)() { return true; }
}
void main()
{
    if (int a = 1)
        assert(a == 1);
    else assert(0);

    if (const int a = 2)
        assert(a == 2);
    else assert(0);

    if (immutable int a = 3)
        assert(a == 3);
    else assert(0);

    if (auto s = S(10))
        assert(s.v == 10);
    else assert(0);

    if (auto s = const(S)(20))
        assert(s.v == 20);
    else assert(0);

    if (auto s = immutable(S)(30))
        assert(s.v == 30);
    else assert(0);
}
----

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

Reply via email to