-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Support nint/intptr conversion on c# 11 and up #76181
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
Conversation
public async Task TestNint1_WithNumericIntPtr_CSharp11_NoRuntimeSupport() | ||
{ | ||
await TestInRegularAndScript1Async(""" | ||
<Workspace> |
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.
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.
because it needs to specify the set of references/runtime the project is configured against. For the legacy test framework (the one that is not using the VerifyCS
pattern) this can only be done with this <Workspace>
format. For the modern test framework, you can do ReferenceAssemblies = ReferencesAssemblies.Net.Net80
and stuff like that.
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.
@CyrusNajmabadi, I don't believe this is correct. The C# 9 feature was to introduce In C# 11, it was changed so that if the runtime feature exists then the language can assume Accordingly, even if a user manually targets C# 11 then on a runtime (such as .NET Framework) without the corresponding runtime feature define, then |
This is covered in the feature speclet: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-11.0/numeric-intptr.md Which explicitly states that the new behavior is only triggered by existence of the |
Will fix in followup. Thanks! |
Fixes #74973