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

add type-forward on IsExternalInit #2621

Merged
merged 2 commits into from
Dec 21, 2023
Merged

add type-forward on IsExternalInit #2621

merged 2 commits into from
Dec 21, 2023

Conversation

mgravell
Copy link
Collaborator

@mgravell mgravell commented Dec 20, 2023

fix #2619

as per guidance from the runtime folks, we should declare a type-forward for IsExternalInit, so that it gets correctly bound (in particular when netstandard is involved, as the build and execution environments are more likely to differ, leading to modreq confusion)

@@ -1,5 +1,7 @@
#if !NET5_0_OR_GREATER

#if NET5_0_OR_GREATER
Copy link
Contributor

@WeihanLi WeihanLi Dec 21, 2023

Choose a reason for hiding this comment

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

Should it be NET6_0_OR_GREATER since we currently support net6.0 target other than net5.0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The "currently" is the key word there. Ok, in reality we're not going to add a 5.0 at this point, but by sticking with the relevant framework version for the feature, if we change the target frameworks: any such #if will sort themselves out automatically, without anything needing to be revisited.

In short: I'm happier with the NET5_OR_GREATER here

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed - updating all the definitions each time is precisely what these defines we're meant to avoid. It tells us which version this code started to be needed in and that's not a terrible thing in itself. I'd vote not to chase these overall - it's just a lot of yearly diff that never ends :)

@mgravell mgravell merged commit d60d987 into main Dec 21, 2023
8 checks passed
@mgravell mgravell deleted the issue-2619 branch December 21, 2023 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants