這段代碼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中運行時沒有問題,所以它可能是與環境有關的問題。 –