This is the next question this sentence .
Apparently, the source of the F # Core library has a flag that allows you to compile 2-tuples as structures. See here . I have done the following:
- Added flag
TUPLE_STRUXTfor FSharp.Core.fsprojand FSharp.Compiler.fsproj. - Built with
build.bat. - Replaced content
C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0and C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.1.0related embedded files.
My project compiles and references the right one (recently built) FSharp.Core.dll. However, 2-tuples are still compiled as classes.
Am I doing something wrong? Or does this code branch actually not matter? The fact that tuples are compiled in System.Tuple, and not the type declared in this code (whether the flag is set TUPLE_STRUXTor not), points to the latter. Is there any way to make it work?
EDIT: After setting the flag, the FX_NO_TUPLEsource does not compile. The error I cannot get around is prim-types.fs <527,7>: error FS0039: The type 'Struct' is not defined. That is, the violation string is the first of the string tuple definition:
[<Struct>]
type Tuple<'T1,'T2> =
new (v1,v2) = { Item1 = v1; Item2 = v2 }
val Item1 : 'T1
val Item2 : 'T2
Does anyone know what causes this?
Arbil source
share