-
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
Report error creating delegate from partial generic method without implementation #73060
Conversation
@@ -2788,7 +2788,7 @@ static ErrorCode getRefMismatchErrorCode(TypeKind type) | |||
return true; | |||
} | |||
|
|||
var sourceMethod = selectedMethod as SourceOrdinaryMethodSymbol; | |||
var sourceMethod = selectedMethod.OriginalDefinition as SourceOrdinaryMethodSymbol; | |||
if (sourceMethod is object && sourceMethod.IsPartialWithoutImplementation) |
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.
There was only one other use of IsPartialWithoutImplementation
, in CallsAreOmitted()
.
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 1)
Consider adding similar tests for VB #Resolved |
Thanks, the same issue existed in VB. In reply to: 2061785068 |
{ | ||
static void Main() | ||
{ | ||
M1(M2<int>); |
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.
Is there also a bug when using a method group like GenericType<int>.PartialMethod
? #Resolved
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.
Yes, tested in _03
. For that case, previously, the assembly was emitted without errors but the IL contained a reference to a missing method.
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 3)
Fixes #72431.