我试图检查变量是否是某种类型,如下所示:
let s = "abc"
let isString = s :? string
Run Code Online (Sandbox Code Playgroud)
但在F#interactive中,我收到以下错误:
error FS0016: The type 'string' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion.
为什么会这样?我希望isString是一个bool.