Skip to content

Commit

Permalink
Final editor side changes for "allow ref struct" support (#73700)
Browse files Browse the repository at this point in the history
Per Tomas, the enc analyzer can be trivially changed for this support.
Also, smal change where I missed one location in method extractor analyzer that needed a change
  • Loading branch information
ToddGrun authored May 24, 2024
1 parent 9f61479 commit 14a96f9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21669,6 +21669,7 @@ class B : System.Attribute {}
[InlineData("unmanaged")]
[InlineData("System.IDisposable")]
[InlineData("System.Delegate")]
[InlineData("allows ref struct")]
public void TypeConstraint_Insert(string newConstraint)
{
var src1 = "class C<S,T> { }";
Expand All @@ -21691,6 +21692,7 @@ public void TypeConstraint_Insert(string newConstraint)
[InlineData("unmanaged")]
[InlineData("System.IDisposable")]
[InlineData("System.Delegate")]
[InlineData("allows ref struct")]
public void TypeConstraint_Delete(string oldConstraint)
{
var src1 = "class C<S,T> where T : " + oldConstraint + " { }";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2355,6 +2355,7 @@ protected static bool TypeParameterConstraintsEquivalent(ITypeParameterSymbol ol
=> TypesEquivalent(oldParameter.ConstraintTypes, newParameter.ConstraintTypes, exact) &&
oldParameter.HasReferenceTypeConstraint == newParameter.HasReferenceTypeConstraint &&
oldParameter.HasValueTypeConstraint == newParameter.HasValueTypeConstraint &&
oldParameter.AllowsRefLikeType == newParameter.AllowsRefLikeType &&
oldParameter.HasConstructorConstraint == newParameter.HasConstructorConstraint &&
oldParameter.HasNotNullConstraint == newParameter.HasNotNullConstraint &&
oldParameter.HasUnmanagedTypeConstraint == newParameter.HasUnmanagedTypeConstraint &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,7 @@ private static IEnumerable<ITypeParameterSymbol> AppendTypeParametersInConstrain
if (!parameter.HasConstructorConstraint &&
!parameter.HasReferenceTypeConstraint &&
!parameter.HasValueTypeConstraint &&
!parameter.AllowsRefLikeType &&
parameter.ConstraintTypes.IsDefaultOrEmpty)
{
continue;
Expand Down

0 comments on commit 14a96f9

Please sign in to comment.