-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Disable unboxing and generic conversions to/from ref-like types #22357
Conversation
cc @jcouv for ask mode approval |
{ | ||
switch (s) | ||
{ | ||
case Span<object> span: |
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.
What about an identity case? Dont see that tested in this PR but seems like it would be valid
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 should be valid and I'll add a test for it.
2964476
to
352e3c2
Compare
@jaredpar I presumed that your approval was both ask mode and PR approval. Was that correct? |
Correct |
* dotnet/master: (33 commits) Test dumper change to include Isimplicit/Language and some formatting change (dotnet#22309) Add regression tests for fixed local function crashes (dotnet#22470) Use error=true in Obsolete attribute on IsByRefLikeAttribute for ref struct (dotnet#22492) Add tests with ref readonly and ref assemblies (dotnet#22419) Add test for sequence point issue with local function and conditional (dotnet#22499) Keep ProjectState._documentStates sorted rather than resorting the IDs Throttle NFW watson. (dotnet#22483) Suggest "in" for argument positions in IDE (dotnet#22480) Disable unboxing and generic conversions to/from ref-like types (dotnet#22357) Hold DocumentIds in ProjectState in ImmutableLists Fix bug in build-utils Ensure-SdkInPathAndData Add additional tests around Span escaping (dotnet#22413) Turn on the compiler server by default for the compiler VSIX (dotnet#22473) add 64bit detect code to razor remote host client (dotnet#22432) Fix a bug in escape analysis related to 'in' arguments (dotnet#22457) Ref must come before 'partial' in a 'ref partial struct' (dotnet#22403) Address PR feedback Ensure partial method implementation is completed when needed (dotnet#22414) Remove PROTOTYPE markers from "private protected" feature (dotnet#22407) added IVariableDeclarationStatement back to for loop's before condition (dotnet#22358) ...
There is no conversion between ref like types and either object or generic parameters (even if constrained to struct) in either direction. This change enforces that rule and adds tests around pattern matching, which exercises this rule.