Is it possible to declare parameters as option types?
For example, when creating a method like this:
var method = CodeMemberMethod {
Name = "Test",
ReturnType = new CodeTypeReference(typeof(string))
};
var parameter = new CodeParameterDeclarationExpression(typeof(FSharpOption<string>), "x");
method.Parameters.Add(param);
It looks like generateTypeRef or getTypeRef could be modified to map FSharpOption<> to Option<> when outputting the F# code, but is that the right thing to do or is there another way?
Is it possible to declare parameters as option types?
For example, when creating a method like this:
the generated code looks something like
but I would like to be able to use the f# Option type, e.g.
It looks like generateTypeRef or getTypeRef could be modified to map FSharpOption<> to Option<> when outputting the F# code, but is that the right thing to do or is there another way?
thanks! Tony