How to call the values of a C# enum in F# -
i'm writing f# code , i'd use enum value defined in c# assembly.
instance, in c# assembly i've got code
public enum myenum { valuea, valueb, valuec }
how call myenum.valuea
in f#? when write that, compiler shouts:
invalid use of type name and/or object constructor. if necessary use 'new' , apply constructor arguments, e.g. 'new type(args)'. required signature is: myenum()
ok... i'm sorry, i've found problem... c# code actually:
public enum myenum { @valuea, @valueb, @valuec }
i know, it's weird, isn't "my" c# code...
to call in f#, have write:
myenum.``valuea``
Comments
Post a Comment