I am experimenting with F# in Unity. I use compiled F# library and FSharp.Core.dll copied to Assets in Unity. Simple scripts work but when I add discriminated union type like
type A =
| AInt of int
| AString of string
then I get this error in Unity: "Unable to load attribute info on method fs.A:.ctor (). Are you missing a reference?". What can be wrong and is there a way to make it work?
CodePudding user response:
Ensure you are using F# 4.1 - 4.8 in order to be compatible with Unity. F# 5 and 6 are incompatible in exactly the same way as a C# project targeting beyond .NET Standard 2.1.