Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# can not find FSharpType.IsRecord in .NET Core #2455

Closed
pocketberserker opened this issue Feb 20, 2017 · 0 comments
Closed

C# can not find FSharpType.IsRecord in .NET Core #2455

pocketberserker opened this issue Feb 20, 2017 · 0 comments

Comments

@pocketberserker
Copy link

pocketberserker commented Feb 20, 2017

This issue is moved from fsharp/fsharp#668 .

Some FSharpType and FSharpValue methods are defined by F# Type Extensions.
However, C# can not access F# Type Extensions.
And Some methods are not defined in .NET Core( https://github.com/fsharp/fsharp/blob/4.1.0.0/src/fsharp/FSharp.Core/reflect.fsi#L266 ).

Repro steps

  1. dotnet new classlib -lang C# and add <PackageReference Include="FSharp.Core" Version="4.1.0" />.

  2. Call Microsoft.FSharp.Reflection.FSharpType.IsRecord

Expected behavior

Build succeeded.

Actual behavior

error CS0117: 'FSharpType' does not contain a definition for 'IsRecord'

Workaround(s)

These methods can call via reflection(e.g. https://github.com/pocketberserker/FSharpNETCoreSandbox/blob/443c35362cbdd167e59ffea03c535fbc251b212e/CsNETCore/Sandbox.cs#L11 ).

Related information

sample project: https://github.com/pocketberserker/FSharpNETCoreSandbox/tree/2fdd6fa60cb3989458f96e77a0265064593e9ae7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant