-
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
Method group natural type: only use methods that can be fully substituted and pass constraint checks #69226
Method group natural type: only use methods that can be fully substituted and pass constraint checks #69226
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -338,6 +338,7 @@ internal sealed class MemberSignatureComparer : IEqualityComparer<Symbol> | |
considerTypeConstraints: false, | ||
refKindCompareMode: RefKindCompareMode.ConsiderDifferences, | ||
considerCallingConvention: false, | ||
considerArity: false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Let's suppose we have two generic methods with different arity, but with the same signature. For example, none of them refer to their type parameters in the signature. Isn't this change going to affect their comparison before substitution? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, the difference is visible in that scenario. Added a test and a legacy comparer. Thanks! |
||
typeComparison: TypeCompareKind.AllIgnoreOptions); | ||
|
||
// Compare the "unqualified" part of the member name (no explicit part) | ||
|
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.
📝 although the legacy logic uses this comparer, it is not affected by this change since it only performs substitution/reduction once a unique signature is found. #Closed