[Mono-dev] 1.2.5 object initializers broken by 1.2.5.1?

Antti S. Lankila alankila at bel.fi
Sat Oct 6 04:12:36 EDT 2007


Hello.

It seems that throwing an exception with object initializers has broken. 
Specifically this code:

    throw new Foo() {
        x = 1, y = 2
    };

behaves differently from:

    var foo = new Foo() {
        x = 1, y = 2;
    };
    throw foo;

It seems that x and y remain with null values.

Also, initializing a dictionary from a list seems to have broken, as 
this does not compile:

    var foo = new Dictionary<string, object>() {
       { "hip", null },
       { "hop", null }
    };

but this used to compile and work with 1.2.5.

-- 
Antti



More information about the Mono-devel-list mailing list