The design rational is that null values are dangerous (or at least anonying) as there use will generally lead to a null reference exception at some point unless you are very careful. So F# actively discourages them, rather than banning them completely. The option type is a much better way to handle the presents or absence of a value.
Having said that F# should allow you to use null values for other language clients who may want that, the following should work:
type IToto =
abstract lolo: int -> int
let toto() = ((null:obj):?>IToto)
But it looks like the code generation is a bit buggy at the moment, when I decompile to C# I see:
public static IToto toto()
{
int num1 = 0.GetHashCode;
return null;
}
So just use the inline IL that Stephan suggests for the moment.
Robert Pickering, MVP
http://strangelights.com