Using F# type extensions in C# #20032
ernestasjuska
started this conversation in
General
Replies: 1 comment 1 reply
-
|
C# currently does not support extension properties. You need to either define them as C#-style extension methods using |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I found that F# class library generates weird method names like
Thing.get_Texturewhich are not discoverable in C# unless using reflection.F# code:
Assembly C# code - the method name is literally
Thing.get_Texture:So to use property Texture from C# I ended up doing:
Source code: https://github.com/ernestasjuska/FSharpIssues.TypeExtensionsDemo
Are there already some solutions for this: like asking F# compiler more nicely or maybe a polyfill for C# end? My quick google and annoying Copilot gave results like dump everything into single file. I don't want that.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions