Problem is emitLambda relies on body.Type to build the FSharpFunc type. body.Type in the case of a _ -> unit function is System.Void so the type getting built is FSharpFunc<_,void>. Meanwhile a function of the form unit -> _ is fine since the first type argument uses the type of the lambda var.
I resorted to using FullName on the generic type definitions to check for FSharpFunc type, maybe there's a better way?
Fixes #279
Problem is
emitLambda
relies onbody.Type
to build theFSharpFunc
type.body.Type
in the case of a_ -> unit
function isSystem.Void
so the type getting built isFSharpFunc<_,void>
. Meanwhile a function of the formunit -> _
is fine since the first type argument uses the type of the lambda var.I resorted to using
FullName
on the generic type definitions to check forFSharpFunc
type, maybe there's a better way?