这段代码F#System.TypeLoadException
module ObjectRe =
type BM = A | N
type Object = {
Name: string
Pattern: BM array
}
let patterns = [|{Name = "Pro"; Pattern = [|A;N;N;A|]} |]
我总是收到此错误信息
System.TypeLoadException: Could not load type 'FSI_0007+ObjectRe+Object[]' from assembly 'FSI-ASSEMBLY, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <94fd79a3b7144c54b4cb162b50fc7761>:0
Stopped due to error
有没有人的想法?我在Mac上使用Visual Studio代码。
谢谢
看起来你错过了在模式定义结束时关闭'|'''。 –
抱歉,我在复制过程中忘记了:/这不是问题 – kudi
FWIW,上面的代码在Windows 10上的Visual Studio 2015中运行时没有问题,所以它可能是与环境有关的问题。 –