Skip to content

Instantly share code, notes, and snippets.

@kant2002
Last active January 25, 2022 04:04
Show Gist options
  • Save kant2002/0c8bbeeeb4b693df2e9d64096e040395 to your computer and use it in GitHub Desktop.
Save kant2002/0c8bbeeeb4b693df2e9d64096e040395 to your computer and use it in GitHub Desktop.
F# test app for reflection-free code
# one time
./build.sh
# when make changes to compiler
dotnet build src/fsharp/fsc/fsc.fsproj
# Compile test application
artifacts/bin/fsc/Debug/net5.0/fsc ../test.fs --targetprofile:netcore --target:exe --out:test.exe
dotnet test.exe
namespace System.Runtime.CompilerServices
//type ReflectionFreeCodeAttribute() = inherit System.Attribute()
namespace Test
open Microsoft.FSharp.Core
type NestedName = NestedName of string
module Test =
[<assembly:ReflectionFreeCode>]
do
()
[<EntryPoint>]
let main argv =
let bb = NestedName "S_S"
printfn "%O" bb
0 // return an integer exit code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment