2

Microsoft (R) F# 2.0 交互式版本 4.0.40219.1

我正在尝试定义新的记录类型:

type TestOptions =
   { perRunGC : bool;
     collectGCStat : bool;
   }

一切都很好,但让我们再添加一个字段:

type TestOptions =
   { perRunGC : bool;
     collectGCStat : bool;
     highPriority : bool;
   }               ^

我在上面标记的位置收到解析器错误:

error FS0010: Unexpected character ' ' in field declaration

我的代码有什么问题?是编译器错误吗?

4

1 回答 1

6

此类错误通常是由源文件中的 unicode 字符引起的。

在这种情况下,您可能在编译器阻塞的位置有一个不间断的空间(或任何其他类型的特殊空间)而不是常规空间。

于 2012-02-27T18:37:28.053 回答