F# equivalent of the C# 'object' keyword -


I am trying to turn off F from an existing C # and I stop blocking this C # line

public object myInnerOject

c # object has only one type of name system Object is referencing . In F #, you can either use this complete .NET name or one type of nickname obj .

Now, in relation to a field announcement - there are several ways to write on the basis of context. Also, it's a good practice to start all areas in F #, so it will be useful to see a larger context of your code.

However, you can write it:

  type A () = shaky (myInnerObj: obj) = null  

this Creates a Private Zone myInnerObj type System.Object to begin null , which is unstable can be specified later (< Code> myInnerObj & lt; - new random () , for example) I used the example with the private field, because public fields are generally disappointed in .NET.


Comments