I have the following type:
and ListInfo() = let mutable count = 0 // This is a mutable option because we can't have an infinite data structure. let mutable lInfo : Option<ListInfo> = None let dInfo = new DictInfo() let bInfo = new BaseInfo() member this.BaseInfo = bInfo member this.DictInfo = dInfo member this.LInfo with get() = lInfo and set(value) = lInfo <- Some(value) member this.Count with get() = count and set(value) = count <- value
where recursive "list information" is an option. Either there or not. I need to use this from C #, but I get errors. This is a usage example:
if (FSharpOption<Types.ListInfo>.get_IsSome(listInfo.LInfo)) { Types.ListInfo subListInfo = listInfo.LInfo.Value; HandleListInfo(subListInfo, n); }
here listInfo is of type ListInfo as above. I'm just trying to check if it contains a value, and if so, then I want to use it. But all calls to listInfo.LInfo give the error "The property, index or event of listInfo.LInfo is not supported by the language ..."
Who understands why?
Umen
source share