-
Notifications
You must be signed in to change notification settings - Fork 790
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
--standalone type forwarding #7462
--standalone type forwarding #7462
Conversation
let typeForwardILTypeRef (tref: ILTypeRef) = | ||
let scoref1 = tref.Scope | ||
let scoref2 = followTypeForwardForILTypeRef tref | ||
if scoref1 === scoref2 then tref |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
===
wat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-)
I read that operator as "is the same as"
It is defined here: https://github.com/dotnet/fsharp/blob/master/src/absil/illib.fs#L44
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, so it's objEq (box x) (box y)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not =
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not instance equality, it's are the contents equal.
* Add type forwarding to static linker * Type forward using simple matches when required * Fix native resource issue with emptry streams * reduce churn * Use typeref morpher
There has long been a bug with the coreclr version of the compiler:
Fixes: #3924 : Support for --standalone on .NET Core
This happens because --standalone takes the Il from FSharp.Core and embeds it in the binary being built. When FSharp.Core references framework assemblies and those assemblies rely on type forwarders to get to the correct type the compiler does not know how to unify the generated method signatures with the type forwarded ones.
The fix in this PR is to follow the type forwarders for everything in thethe generated code and embedded code.
This only happens in the static linker, and so will have no impact to the majority of applications.
Static linking occurs for:
This fix is also necessary for us to move to a single netstandard 2.0 version of FSharp.Core rather than dual desktop and netstandard versions. Because even the desktop --standalone which has always work would start failing for that scenario.
Note:
The pr also contains this fix: #7461