--standalone type forwarding#7462
Merged
KevinRansom merged 7 commits intodotnet:masterfrom Sep 4, 2019
Merged
Conversation
dsyme
reviewed
Aug 29, 2019
brettfo
approved these changes
Sep 3, 2019
cartermp
reviewed
Sep 3, 2019
| let typeForwardILTypeRef (tref: ILTypeRef) = | ||
| let scoref1 = tref.Scope | ||
| let scoref2 = followTypeForwardForILTypeRef tref | ||
| if scoref1 === scoref2 then tref |
Contributor
Author
There was a problem hiding this comment.
:-)
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
Contributor
There was a problem hiding this comment.
ah, so it's objEq (box x) (box y)
Contributor
Author
There was a problem hiding this comment.
It's not instance equality, it's are the contents equal.
nosami
pushed a commit
to xamarin/visualfsharp
that referenced
this pull request
Feb 23, 2021
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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