相关疑难解决方法(0)

F#为什么我不能使用:?运营商在F#互动?

我试图检查变量是否是某种类型,如下所示:

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.

f# typechecking f#-interactive

1
推荐指数
1
解决办法
573
查看次数

标签 统计

f# ×1

f#-interactive ×1

typechecking ×1