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

Remove IUnboundLambda #18057

Closed
mavasani opened this issue Mar 22, 2017 · 5 comments
Closed

Remove IUnboundLambda #18057

mavasani opened this issue Mar 22, 2017 · 5 comments
Assignees
Milestone

Comments

@mavasani
Copy link
Contributor

  1. Paste the following code in ETA:
using System;

class Program
{
    static void Main(string[] args)
    {
        var x = () => F();
    }

    static void F()
    {
    }
}
  1. Display IOperation tree for the EqualsValueClauseSyntax. Note that we have no IOperations for code inside the lambda body.
IOperation tree for "= () => F()"

IVariableDeclarationStatement (1 variables) (OperationKind.VariableDeclarationStatement, IsInvalid)
  IVariableDeclaration: var x (OperationKind.VariableDeclaration)
    Initializer: IUnboundLambdaExpression (OperationKind.UnboundLambdaExpression, Type: null)
  1. Display IOperation tree for the ParenthesizedLambdaExpressionSyntax.
IOperation tree for "() => F()"

ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null)
  IBlockStatement (1 statements) (OperationKind.BlockStatement)
    IExpressionStatement (OperationKind.ExpressionStatement)
      IInvocationExpression (static void Program.F()) (OperationKind.InvocationExpression, Type: System.Void)

I expected the IOperation tree in 3. to be a sub-tree of IOperation tree of 2.

@mavasani mavasani added this to the 15.3 milestone Mar 22, 2017
@mavasani
Copy link
Contributor Author

Tagging @dotnet/analyzer-ioperation

@mavasani
Copy link
Contributor Author

mavasani commented Mar 22, 2017

This might actually be a missing API issue. UnboundLambda generally contains a BoundLambda node within it for error recovery, we should probably expose it. @AlekseyTs your thoughts?

@AlekseyTs
Copy link
Contributor

This might actually be a missing API issue. UnboundLambda generally contains a BoundLambda node within it for error recovery, we should probably expose it.

I think the IUnboundLambdaExpression should not be a part of the API.

@mavasani
Copy link
Contributor Author

@jinujoseph @CyrusNajmabadi can we add this issue to the list of API discussions for next week?

@jinujoseph
Copy link
Contributor

Design Team Decision

We are in agreement that IUnboundLambdaExpression should not be part of our API, it's not correct and appropriate. It would be great if we expose ILamda where we give the best effort to get the
Method symbol and the body.

@jinujoseph jinujoseph modified the milestones: 15.later, 15.3 Apr 18, 2017
@jinujoseph jinujoseph assigned 333fred and unassigned heejaechang Jun 8, 2017
@jinujoseph jinujoseph modified the milestones: 15.3, 15.later, 15.6 Jun 8, 2017
@333fred 333fred changed the title We lose the IOperation sub-tree in lambda body for unbound lambda Remove IUnboundLambda Jun 13, 2017
@333fred 333fred added the 4 - In Review A fix for the issue is submitted for review. label Jun 13, 2017
@333fred 333fred closed this as completed Jun 20, 2017
@333fred 333fred removed the 4 - In Review A fix for the issue is submitted for review. label Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants