I’m trying:
let mutable ncon : NCon = null
and getting:
Error 1 The type 'NCon' does not have 'null' as a proper value
where type is declard in this way
type NCon(settings : ISettings) = ...
I’m planning to use it as static property and init it later when user will finish the settings so what am I doing wrong? why can’t I init mutable type with null?
must I use option? so to make it to be None or Some instead?
You have to supply a AllowNullLiteral to your NCon-Type like this:
This is because F# prevents you from using Null … not a bad idea IMHO
To your other questions:
Yes I would rather use an option – and I would consider using a ref-cell too – but this depends on what you want to do with it.