Skip to content
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

BoundDelegateCreationExpression does not implement IMethodBindingExpression #19917

Closed
333fred opened this issue May 31, 2017 · 5 comments
Closed
Assignees
Labels
Area-Analyzers Bug Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature - IOperation IOperation Urgency-Soon
Milestone

Comments

@333fred
Copy link
Member

333fred commented May 31, 2017

Given the following VB code;

Public Class C1
    Private _handler As Action(Of Object)

    Public Sub Handler(o As Object)
    End Sub

    Public Sub SetupHandler()
        _handler = AddressOf Handler
    End Sub
End Class

We get the following Operation tree for AddressOf Handler;

IOperation tree for "AddressOf Handler"

IOperation:  (OperationKind.None) (Syntax: 'AddressOf Handler')
  Children(1): IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: C1) (Syntax: 'Handler')

This is because that AddressOf results in a BoundDelegateCreationExpression, which does not implement IMethodBindingExpression. I think the fix here is just to make it implement the interface. @AlekseyTs, does that sound correct to you?

@333fred
Copy link
Member Author

333fred commented May 31, 2017

FYI @dotnet/analyzer-ioperation

@mavasani
Copy link
Contributor

BoundDelegateCreationExpression also takes an argument for C#. It does not seem right for it to implement just IMethodBindingExpression. We already have a tracking bug for designing the correct API for exposing this bound node.

@mavasani
Copy link
Contributor

See #18839

@mavasani
Copy link
Contributor

And also #8897

@333fred 333fred added the Concept-API This issue involves adding, removing, clarification, or modification of an API. label May 31, 2017
@jinujoseph jinujoseph added this to the 15.5 milestone Jul 3, 2017
@333fred
Copy link
Member Author

333fred commented Jul 6, 2017

Dupe of #20095.

@333fred 333fred closed this as completed Jul 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers Bug Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature - IOperation IOperation Urgency-Soon
Projects
None yet
Development

No branches or pull requests

3 participants