下一个例子中的代码,
open System.Drawing
let testColor c =
match c with
| Color.Black -> 1
| Color.White -> 0
| _ -> failwith "unexpected color"
Run Code Online (Sandbox Code Playgroud)
不编译.错误是Error 1 The field, constructor or member 'Black' is not defined.
如何模拟以大写字母开头的.Net常量或枚举的匹配?
对于它的价值,编译器是"Microsoft(R)F#2.0 Interactive build 4.0.30319.1".