-
Notifications
You must be signed in to change notification settings - Fork 821
Remove inline IL parsing method call #7947
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
Remove inline IL parsing method call #7947
Conversation
This example: let test () = hash "" Will emit a tail call right before the call virt let test () = "".GetHashCode() The tail call is an issue in general, see #6329; but at least |
Having trouble getting this to pass CI. Some tests are not using the built FSharp.Core and are instead referencing a package. |
just a note for whoever it may help in the future, removing the ability to compile those IL method calls will make trying to compile pre-existing PRs fail with this message:
|
Despite it may be true, and Microsoft stance on supporting undocumented or non public things is well known, it may be safer to not remove the ability to do the IL method calls just on basis of removing it's sole usage in FSharp.Core Inline IL is used in open source libraries such as FSharpPlus, FSharp.UMX and probably others, and it is likely that it is relied in closed codebases, removing the ability to do IL method calls may break things (not FSharpPlus or FSharp.UMX AFAIK), are we really saving anything by removing its support? |
@smoothdeveloper this PR doesn't remove the ability to do inline IL calls. It just the sole case in the compiler codebase. |
Just a quick scan of those libraries doesn't show them using the |
A full GitHub search also yields no usage of this from what I can tell: https://github.com/search?p=4&q=compiling-fslib&type=Code That doesn't account for internal codebases of course, but I think we're well within the threshold of acceptability if there is no apparent usage of this internal feature in F# OSS libraries |
@cartermp, what I was saying
of course it doesn't remove inline IL, it does remove IL method calls ( Yes nothing on github shows usage of I was just trying to:
edit: the other impact is we get a |
No one other than FSharp.Core should be using inline IL. In fact, I wish we could get rid of inline IL altogether and have more intrinsics, but that is another day. Using the @smoothdeveloper I understand your concern. If the compiler allows you to do a 'thing', then people can and will do the 'thing'. That's true, but for features like this it is communicated in advance they are only for specific cases and are not supported. If we are concerned about the use of these kind of features, then having a Regarding this specific inline IL feature, I am not worried in the slightest. |
Changing |
* Remove inline IL parsing method call * Remove now dead code * Fixing tests * Trying to fix tests * Trying to fix tests * Trying to fix tests * Update ExprTests.fs
Found an inline IL expression in FSharp.Core where all it did was make a call to string's
GetHashCode
. It can be replaced with a normal expression call.Since this was the only place where this kind of inline IL was ever used, I removed the ability to do inline IL method calls. Inline IL is only meant for FSharp.Core.