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

Antti S. Lankila alankila at bel.fi
Sun Oct 7 09:18:29 EDT 2007


Marek Safar wrote:
> Please use SVN version of gmcs it contains significantly improved 
> support of C# 3.0 and
> I was able to compile and run all your code samples. Also there was no 
> compiler
> changes between 1.2.5 and 1.2.5.x

I need some kind of semi-stable version for production usage but nothing 
prevents me from compiling one under /usr/local/mono-svn-trunk or 
something, I guess. It's probably going to take a while, because this 
seems to be quite a large undertaking...

My observations are on a hybridish system, half based on ubuntu gutsy 
with mono parts from debian sid, which is more up-to-date (because I 
want to use those C# 3.0 features). This probably calls my experiences a 
bit into suspicion. In the meantime, I'd appreciate if someone with a 
debian sid or installed versions of the official 1.2.5.1 packages could 
briefly compile and run the following:

   http://bel.fi/~alankila/test.cs

When I try to compile it, I get:

% gmcs -langversion:linq test.cs
test.cs(30,23): error CS1526: A new expression requires () or [] after type
test.cs(31,27): error CS1002: Expecting `;'
Compilation failed: 2 error(s), 0 warnings

After commenting out the "new Dictionary" part with initializer, 
starting from line 30:

% gmcs -langversion:linq test.cs
% mono test.exe
Result of exception test: doesn't work

It may be noteworthy that a list initializer like this works here, too:

    var baz = new List<string>() { "hip", "hop" };

I hope to god I didn't make any syntax error of my own on the lines 30-32.

-- 
Antti



More information about the Mono-devel-list mailing list