[Mono-list] Differing nullable behavior

Pedro Sobota pedro at sobota.net
Fri Aug 4 13:03:27 EDT 2006


Hi,

It seems in Mono, nullables are seen as value types, like the values 
they contain. This is different from the .Net Framework, for example, 
this code compiles and works on .Net, but not on Mono:

using System;

class Global {
    static void Main() {
        Console.Write(2 as int?);
    }
}

On Mono the result is error CS0077: The as operator must be used with a 
reference type ('int?' is a value type).

Is this intended, or a bug?

Pedro


More information about the Mono-list mailing list