Using an FSharp.Expr variable in a distributed test causes a warning because the compiler adds debug information containing file paths (NCrunch 3.8.0.3)
To reproduce: (F# 4.1, VS2017)
- Create an F# class library project and add the NUnit 3.7 Nuget package
- Use the following test implementation
Code:
namespace ExpressionTest
open NUnit.Framework
[<TestFixture>]
type Fixture1() =
[<Test>]
member __.Test1 () =
let expression = <@ 99 @>
Assert.AreEqual("Hello", "Hello")
The full path to the source file is stored in a byte array, and the length of the path affect the name (288Bytes here)
Code:
.class private abstract auto ansi sealed beforefieldinit '<PrivateImplementationDetails$ExpressionTest>'
extends [mscorlib]System.Object
{
.class explicit ansi sealed nested assembly beforefieldinit T1799_288Bytes@
extends [mscorlib]System.ValueType
{
.pack 0
.size 288
} // end of class T1799_288Bytes@
} // end of class '<PrivateImplementationDetails$ExpressionTest>'
and also the call to deserialize the info (0x120 here)
Code:
IL_0088: ldc.i4 0x120
IL_008d: newarr [mscorlib]System.Byte
IL_0092: dup
IL_0093: ldtoken field valuetype '<PrivateImplementationDetails$ExpressionTest>'/T1799_288Bytes@ '<StartupCode$ExpressionTest>'.$Library1::field1800@
IL_0098: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array,
valuetype [mscorlib]System.RuntimeFieldHandle)
IL_009d: call class [FSharp.Core]Microsoft.FSharp.Quotations.FSharpExpr [FSharp.Core]Microsoft.FSharp.Quotations.FSharpExpr::Deserialize40(class [mscorlib]System.Type,
class [mscorlib]System.Type[],
class [mscorlib]System.Type[],
class [FSharp.Core]Microsoft.FSharp.Quotations.FSharpExpr[],
uint8[])