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

Fix #13197 #13870

Merged
merged 5 commits into from
Sep 13, 2022
Merged

Fix #13197 #13870

merged 5 commits into from
Sep 13, 2022

Conversation

dsyme
Copy link
Contributor

@dsyme dsyme commented Sep 9, 2022

Fixes regression #13197 related to multiemit (actually, it's related to the use of the ILWrite binary writer rather then Reflection.Emit).

The problem here is that when /usesdkrefs- is used, the "actual" primary assembly of the compilation is System.Private.CoreLib - i.e. that's where System.Object is defined. However the "target" primary assembly we use remains System.Runtime - that is that's what we code generate for.

To emit correct code we need to detect that System.Private.CoreLib is an equivalent primary assembly reference.

@dsyme dsyme changed the title Fix https://github.com/dotnet/fsharp/issues/13197 Fix #13197 Sep 9, 2022
@dsyme
Copy link
Contributor Author

dsyme commented Sep 9, 2022

This is ready

Copy link
Member

@KevinRansom KevinRansom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this.

I chatted with @dsyme and we agreed that, in the longer term we need to use type the type-forwards and similar metadata to establish type identity rather than hard coded equivalence based on type + Assembly Identity. However, this solution solves the immediate issue and it is an issue we expect to see others encounter without this fix.

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

Successfully merging this pull request may close these issues.

2 participants