-
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
IOperation API support for BoundDynamicInvocation #20114
Comments
@jinujoseph We can discuss this today. |
Design Team Decision We should have at least have "Name" and "Ref Kind" Take a look what's given to runtime binder, and also look at different flavors of dynamic operation. |
See #21711 (comment) for discussion |
Design decision: have IDynamicInvocationExpression. // Always null for VB. Documented as what it does for C#
RefKind? GetRefKind(int argumentIndex);
// Returns null if not a named arg. Or the name if it was.
string GetArgumentName(int argumentIndex); (Names can be tweaked) -- IDynamicMemberAccessExpression -- IDynamicIndexerAccessExpression -- IDynamicObjectCreationExpressoin |
Confirmed there is no dynamic/late bound object creation in VB. Source code:
Errors:
Operation Tree:
|
Fixed with #21711 |
This bound node is very similar to BoundCall, except that we have a set of applicable methods instead of a single TargetMethod.
We have couple of choices for the API here:
IInvocationExpression
, and set theTargetMethod
to null. In future, when we expose the MethodGroup from IInvocationExpression, the applicable methods can be exposed through this API.(1) is similar to the approach we chose for Dynamic collection initializer, but it might be more error prone for analyzer authors as everyone might expect a non-null
IInvocationExpression.TargetMethod
method for an error free case.The text was updated successfully, but these errors were encountered: