-
Notifications
You must be signed in to change notification settings - Fork 4k
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 more ref readonly
tests and address comments
#69183
Conversation
@@ -386,6 +386,9 @@ internal sealed class MemberSignatureComparer : IEqualityComparer<Symbol> | |||
_typeComparison = typeComparison; | |||
Debug.Assert((_typeComparison & TypeCompareKind.FunctionPointerRefMatchesOutInRefReadonly) == 0, | |||
$"Rely on the {nameof(refKindCompareMode)} flag to set this to ensure all cases are handled."); | |||
Debug.Assert((_refKindCompareMode & RefKindCompareMode.AllowRefReadonlyVsInMismatch) == 0 || | |||
(_refKindCompareMode & RefKindCompareMode.ConsiderDifferences) != 0, | |||
$"Cannot set {nameof(RefKindCompareMode.AllowRefReadonlyVsInMismatch)} without {nameof(RefKindCompareMode.ConsiderDifferences)}."); |
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.
Consider making the assert more general. I.e. either _refKindCompareMode == DoNotConsiderDifferences
, or the ConsiderDifferences
flag is set. #Closed
} | ||
|
||
[Fact] | ||
public void ExpressionTrees() |
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.
@@ -4606,6 +4734,30 @@ static void Main() | |||
Diagnostic(ErrorCode.WRN_OverridingDifferentRefness, "M2").WithArguments("in int x", "ref readonly int x").WithLocation(9, 12)); | |||
} | |||
|
|||
[Fact] | |||
public void Implementation_RefReadonly_In_Close() |
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.
No, the point is to test MemberSignatureComparer.CSharpCloseImplicitImplementationComparer
Done with review pass (commit 5) |
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.
LGTM (commit 8)
@jcouv for a second review, thanks |
@@ -783,6 +783,21 @@ private static void SubstituteConstraintTypes(ImmutableArray<TypeWithAnnotations | |||
} | |||
|
|||
return true; | |||
|
|||
static bool areRefKindsCompatible(RefKindCompareMode refKindCompareMode, RefKind refKind1, RefKind refKind2) |
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.
Thanks. This was much easier to follow :-)
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.
LGTM Thanks (iteration 8)
modreq(In)
emitted for synthesized delegateInvoke
method #69079 (comment)Test plan: #68056