Anonymous objects in c#

Outside of Unity (c# console compiler for example)
anonymous objects work fine,

an example of one would typically look like this:

object obj = new {x=1,y=1};

or

var obj = new {x=1,y=1};

In Unity however, it shows a pre-compiler error:
): error CS1031: Type expected

Anybody know the reason?

Anonymous types are a later addition to C#, and are not included in the version of Mono that Unity uses.

Unity is also missing Extension methods as well.

This should be rectified soon, as the most recent version of Mono does have support for these features, however you will likely have to wait for a Major Unity release.

You’re right, I knew that anon objs were made available in version 3 of mono, and unity uses 2.0, I just hadn’t made that connection.

Probably not possible to swap out Unity’s mono libraries for new ones, is it…?
Or does the new version of Unity (3.0) use recent Mono framework?

I read here somewhere on the forums that there are internal conflicts between the most recent version of Mono and Unity, so I think a major release is gonna be needed.

Though on the bright side 3.0 is coming closer on the horizon and fingers are crossed.