From f900a819ce4e4ed45d29acbd4f2aaab4f5f4267e Mon Sep 17 00:00:00 2001 From: Manish Vasani Date: Wed, 26 Jul 2017 11:35:01 -0700 Subject: [PATCH 1/8] Add IOperation support for query operations. Implements the proposal discussed in https://github.com/dotnet/roslyn/issues/17838#issuecomment-318125250. 1. We will have an `IQueryExpression` representing the topmost query expression. 2. This will point to the last query clause (`IQueryClause`) or continuation (`IQueryContinuation`) in the unrolled lowered bound tree - we are not got going to reverse the tree to match source. 3. `IQueryClause` will have a `QueryClauseKind` field indicating the type of query clause, which should match the syntax/language specification query clause/operator kinds. --- .../Operations/CSharpOperationFactory.cs | 133 + .../IOperationTests_IForLoopStatement.cs | 240 +- ...tionTests_IParameterReferenceExpression.cs | 38 +- .../Test/Semantic/Semantics/QueryTests.cs | 1616 ++++++++- .../Generated/Operations.xml.Generated.cs | 908 +++++ .../Core/Portable/Operations/OperationKind.cs | 12 +- .../Portable/Operations/OperationVisitor.cs | 190 + .../Queries/IAggregateQueryClause.cs | 15 + .../Queries/IAggregationExpression.cs | 24 + .../Queries/IDistinctQueryClause.cs | 15 + .../Operations/Queries/IFromQueryClause.cs | 17 + .../Operations/Queries/IGroupByQueryClause.cs | 15 + .../Queries/IGroupJoinQueryClause.cs | 15 + .../Queries/IJoinIntoQueryClause.cs | 15 + .../Operations/Queries/IJoinQueryClause.cs | 15 + .../Operations/Queries/ILetQueryClause.cs | 15 + .../Operations/Queries/IOrderByQueryClause.cs | 15 + .../Operations/Queries/IOrderExpression.cs | 23 + .../Operations/Queries/IQueryClause.cs | 24 + .../Operations/Queries/IQueryContinuation.cs | 24 + .../Operations/Queries/IQueryExpression.cs | 21 + .../Operations/Queries/ISelectQueryClause.cs | 17 + .../Operations/Queries/ISkipQueryClause.cs | 15 + .../Queries/ISkipWhileQueryClause.cs | 15 + .../Operations/Queries/ITakeQueryClause.cs | 15 + .../Queries/ITakeWhileQueryClause.cs | 15 + .../Operations/Queries/IWhereQueryClause.cs | 15 + .../Portable/Operations/Queries/OrderKind.cs | 26 + .../Operations/Queries/QueryClauseKind.cs | 44 + .../Core/Portable/PublicAPI.Unshipped.txt | 95 +- .../Operations/VisualBasicOperationFactory.vb | 159 + ...tionTests_IParameterReferenceExpression.vb | 176 +- .../Semantic/Semantics/QueryExpressions.vb | 3097 ++++++++++++++++- .../Compilation/OperationTreeVerifier.cs | 135 + .../Compilation/TestOperationWalker.cs | 101 + 35 files changed, 6792 insertions(+), 523 deletions(-) create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IAggregateQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IAggregationExpression.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IDistinctQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IFromQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IGroupByQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IGroupJoinQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IJoinIntoQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IJoinQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/ILetQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IOrderByQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IOrderExpression.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IQueryContinuation.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IQueryExpression.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/ISelectQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/ISkipQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/ISkipWhileQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/ITakeQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/ITakeWhileQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/IWhereQueryClause.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/OrderKind.cs create mode 100644 src/Compilers/Core/Portable/Operations/Queries/QueryClauseKind.cs diff --git a/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs b/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs index 3644c9f890ea7..6068526b7cb22 100644 --- a/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs +++ b/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs @@ -218,6 +218,8 @@ private IOperation CreateInternal(BoundNode boundNode) return CreateBoundPatternSwitchLabelOperation((BoundPatternSwitchLabel)boundNode); case BoundKind.IsPatternExpression: return CreateBoundIsPatternExpressionOperation((BoundIsPatternExpression)boundNode); + case BoundKind.QueryClause: + return CreateBoundQueryClauseOrExpressionOperation((BoundQueryClause)boundNode); default: var constantValue = ConvertToOptional((boundNode as BoundExpression)?.ConstantValue); return Operation.CreateOperationNone(boundNode.Syntax, constantValue, getChildren: () => GetIOperationChildren(boundNode)); @@ -1335,5 +1337,136 @@ private IIsPatternExpression CreateBoundIsPatternExpressionOperation(BoundIsPatt Optional constantValue = ConvertToOptional(boundIsPatternExpression.ConstantValue); return new LazyIsPatternExpression(expression, pattern, syntax, type, constantValue); } + + private IOperation CreateBoundQueryClauseOrExpressionOperation(BoundQueryClause boundQueryClause) + { + var queryClauseKindOpt = GetQueryClauseKind(boundQueryClause); + return queryClauseKindOpt.HasValue ? + CreateBoundQueryClauseOperation(boundQueryClause, queryClauseKindOpt.Value) : + CreateBoundQueryOrContinuationOrOrderExpressionOperation(boundQueryClause); + } + + private IQueryClause CreateBoundQueryClauseOperation(BoundQueryClause boundQueryClause, QueryClauseKind queryClauseKind) + { + Lazy underlyingExpression = new Lazy(() => Create(boundQueryClause.Value)); + SyntaxNode syntax = boundQueryClause.Syntax; + ITypeSymbol type = boundQueryClause.Type; + Optional constantValue = ConvertToOptional(boundQueryClause.ConstantValue); + + switch(queryClauseKind) + { + case QueryClauseKind.FromClause: + return new LazyFromQueryClause(underlyingExpression, syntax, type, constantValue); + + case QueryClauseKind.SelectClause: + return new LazySelectQueryClause(underlyingExpression, syntax, type, constantValue); + + case QueryClauseKind.WhereClause: + return new LazyWhereQueryClause(underlyingExpression, syntax, type, constantValue); + + case QueryClauseKind.LetClause: + return new LazyLetQueryClause(underlyingExpression, syntax, type, constantValue); + + case QueryClauseKind.OrderByClause: + return new LazyOrderByQueryClause(underlyingExpression, syntax, type, constantValue); + + case QueryClauseKind.GroupByClause: + return new LazyGroupByQueryClause(underlyingExpression, syntax, type, constantValue); + + case QueryClauseKind.JoinClause: + return new LazyJoinQueryClause(underlyingExpression, syntax, type, constantValue); + + case QueryClauseKind.JoinIntoClause: + return new LazyJoinIntoQueryClause(underlyingExpression, syntax, type, constantValue); + + default: + throw ExceptionUtilities.Unreachable; + } + } + + private IOperation CreateBoundQueryOrContinuationOrOrderExpressionOperation(BoundQueryClause boundQueryClause) + { + switch(boundQueryClause.Syntax.Kind()) + { + case SyntaxKind.QueryExpression: + return CreateBoundQueryExpressionOperation(boundQueryClause); + + case SyntaxKind.QueryContinuation: + return CreateBoundQueryContinuationOperation(boundQueryClause); + + case SyntaxKind.AscendingOrdering: + return CreateBoundOrderingExpressionOperation(boundQueryClause, OrderKind.Ascending); + + case SyntaxKind.DescendingOrdering: + return CreateBoundOrderingExpressionOperation(boundQueryClause, OrderKind.Descending); + + case SyntaxKind.QueryBody: + return boundQueryClause.Value != null ? CreateBoundQueryClauseOrExpressionOperation((BoundQueryClause)boundQueryClause.Value) : null; + + default: + throw ExceptionUtilities.Unreachable; + } + } + + private IQueryExpression CreateBoundQueryExpressionOperation(BoundQueryClause boundQueryClause) + { + Lazy lastClauseOrContinuation = new Lazy(() => Create(boundQueryClause.Value)); + SyntaxNode syntax = boundQueryClause.Syntax; + ITypeSymbol type = boundQueryClause.Type; + Optional constantValue = ConvertToOptional(boundQueryClause.ConstantValue); + return new LazyQueryExpression(lastClauseOrContinuation, syntax, type, constantValue); + } + + private IQueryContinuation CreateBoundQueryContinuationOperation(BoundQueryClause boundQueryClause) + { + Lazy queryBody = new Lazy(() => Create(boundQueryClause.Value)); + IRangeVariableSymbol definedSymbol = boundQueryClause.DefinedSymbol; + SyntaxNode syntax = boundQueryClause.Syntax; + ITypeSymbol type = boundQueryClause.Type; + Optional constantValue = ConvertToOptional(boundQueryClause.ConstantValue); + return new LazyQueryContinuation(queryBody, definedSymbol, syntax, type, constantValue); + } + + private IOrderingExpression CreateBoundOrderingExpressionOperation(BoundQueryClause boundQueryClause, OrderKind orderKind) + { + Lazy expression = new Lazy(() => Create(boundQueryClause.Value)); + SyntaxNode syntax = boundQueryClause.Syntax; + ITypeSymbol type = boundQueryClause.Type; + Optional constantValue = ConvertToOptional(boundQueryClause.ConstantValue); + return new LazyOrderingExpression(expression, orderKind, syntax, type, constantValue); + } + + private QueryClauseKind? GetQueryClauseKind(BoundQueryClause boundQueryClause) + { + switch(boundQueryClause.Syntax.Kind()) + { + case SyntaxKind.FromClause: + return QueryClauseKind.FromClause; + + case SyntaxKind.SelectClause: + return QueryClauseKind.SelectClause; + + case SyntaxKind.WhereClause: + return QueryClauseKind.WhereClause; + + case SyntaxKind.LetClause: + return QueryClauseKind.LetClause; + + case SyntaxKind.OrderByClause: + return QueryClauseKind.OrderByClause; + + case SyntaxKind.GroupClause: + return QueryClauseKind.GroupByClause; + + case SyntaxKind.JoinClause: + return QueryClauseKind.JoinClause; + + case SyntaxKind.JoinIntoClause: + return QueryClauseKind.JoinIntoClause; + + default: + return null; + } + } } } diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.cs index f6126bc734227..9b176d4adc0e4 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.cs @@ -1338,76 +1338,68 @@ select z into w IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'str = from ... select w') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'str = from ... select w') Variables: Local_1: System.Collections.Generic.IEnumerable str - Initializer: IOperation: (OperationKind.None) (Syntax: 'from x in "" ... select w') - Children(1): - IOperation: (OperationKind.None) (Syntax: 'into w ... select w') - Children(1): - IOperation: (OperationKind.None) (Syntax: 'select w') - Children(1): - IOperation: (OperationKind.None) (Syntax: 'select w') - Children(1): - IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select w') + Initializer: IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in "" ... select w') + LastClauseOrContinuation: IQueryContinuation (Declared symbol: ? w) (OperationKind.QueryContinuation) (Syntax: 'into w ... select w') + Query Body: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select w') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select w') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'select z') + ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select z') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select<, System.String>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.String> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select z') Instance Receiver: null Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'select z') - IOperation: (OperationKind.None) (Syntax: 'select z') - Children(1): - IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select<, System.String>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.String> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select z') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') - IOperation: (OperationKind.None) (Syntax: 'let z = x.ToString()') - Children(1): - IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'let z = x.ToString()') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from x in ""123""') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in ""123""') - Operand: IOperation: (OperationKind.None) (Syntax: 'from x in ""123""') - Children(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""123"") (Syntax: '""123""') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x.ToString()') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x.ToString()') - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x.ToString()') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x.ToString()') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x.ToString()') - ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Char x, System.String z)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'let z = x.ToString()') - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') - IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Char) (Syntax: 'let z = x.ToString()') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'x.ToString()') - IInvocationExpression (virtual System.String System.Char.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'x.ToString()') - Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'x') - Arguments(0) - InConversion: null - OutConversion: null - Initializer: null - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'z') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, System.String>) (Syntax: 'z') - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'z') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'z') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'z') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'z') - InConversion: null - OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') + ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'let z = x.ToString()') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'let z = x.ToString()') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from x in ""123""') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in ""123""') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in ""123""') + ReducedExpression: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""123"") (Syntax: '""123""') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x.ToString()') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x.ToString()') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x.ToString()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x.ToString()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x.ToString()') + ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Char x, System.String z)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'let z = x.ToString()') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Char) (Syntax: 'let z = x.ToString()') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'x.ToString()') + IInvocationExpression (virtual System.String System.Char.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'x.ToString()') + Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'x') + Arguments(0) + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'w') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'w') - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'w') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'w') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'w') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'w') + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'z') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, System.String>) (Syntax: 'z') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'z') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'z') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'z') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'z') InConversion: null OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'w') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'w') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'w') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'w') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'w') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'w') + InConversion: null + OutConversion: null AtLoopBottom(0) Body: IBlockStatement (2 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IForEachLoopStatement (Iteration variable: System.String item) (LoopKind.ForEach) (OperationKind.LoopStatement) (Syntax: 'foreach (va ... }') @@ -1472,76 +1464,68 @@ select z into w AtLoopBottom(0) Body: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'return from ... select w;') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'from x in "" ... select w') - Children(1): - IOperation: (OperationKind.None) (Syntax: 'into w ... select w') - Children(1): - IOperation: (OperationKind.None) (Syntax: 'select w') - Children(1): - IOperation: (OperationKind.None) (Syntax: 'select w') - Children(1): - IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select w') + ReturnedValue: IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in "" ... select w') + LastClauseOrContinuation: IQueryContinuation (Declared symbol: ? w) (OperationKind.QueryContinuation) (Syntax: 'into w ... select w') + Query Body: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select w') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select w') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'select z') + ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select z') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select<, System.String>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.String> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select z') Instance Receiver: null Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'select z') - IOperation: (OperationKind.None) (Syntax: 'select z') - Children(1): - IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select<, System.String>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.String> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select z') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') - IOperation: (OperationKind.None) (Syntax: 'let z = x.ToString()') - Children(1): - IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'let z = x.ToString()') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from x in ""123""') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in ""123""') - Operand: IOperation: (OperationKind.None) (Syntax: 'from x in ""123""') - Children(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""123"") (Syntax: '""123""') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x.ToString()') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x.ToString()') - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x.ToString()') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x.ToString()') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x.ToString()') - ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Char x, System.String z)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'let z = x.ToString()') - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') - IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Char) (Syntax: 'let z = x.ToString()') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'x.ToString()') - IInvocationExpression (virtual System.String System.Char.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'x.ToString()') - Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'x') - Arguments(0) - InConversion: null - OutConversion: null - Initializer: null - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'z') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, System.String>) (Syntax: 'z') - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'z') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'z') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'z') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'z') - InConversion: null - OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') + ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'let z = x.ToString()') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'let z = x.ToString()') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from x in ""123""') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in ""123""') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in ""123""') + ReducedExpression: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""123"") (Syntax: '""123""') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x.ToString()') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x.ToString()') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x.ToString()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x.ToString()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x.ToString()') + ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Char x, System.String z)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'let z = x.ToString()') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Char) (Syntax: 'let z = x.ToString()') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'x.ToString()') + IInvocationExpression (virtual System.String System.Char.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'x.ToString()') + Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'x') + Arguments(0) + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'w') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'w') - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'w') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'w') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'w') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'w') + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'z') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, System.String>) (Syntax: 'z') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'z') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'z') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'z') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'z') InConversion: null OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'w') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'w') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'w') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'w') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'w') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'w') + InConversion: null + OutConversion: null "; VerifyOperationTreeForTest(source, expectedOperationTree); } diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.cs index db8fbd430433b..690fa59f967bb 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; @@ -138,29 +138,19 @@ public void M(List customers) } "; string expectedOperationTree = @" -IOperation: (OperationKind.None) (Syntax: 'from cust i ... t cust.Name') - Children(1): - IOperation: (OperationKind.None) (Syntax: 'select cust.Name') - Children(1): - IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select cust.Name') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from cust in customers') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from cust in customers') - Operand: IOperation: (OperationKind.None) (Syntax: 'from cust in customers') - Children(1): - IParameterReferenceExpression: customers (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'customers') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'cust.Name') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'cust.Name') - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'cust.Name') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'cust.Name') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'cust.Name') - ReturnedValue: IPropertyReferenceExpression: System.String Customer.Name { get; set; } (OperationKind.PropertyReferenceExpression, Type: System.String) (Syntax: 'cust.Name') - Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'cust') - InConversion: null - OutConversion: null +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable(Of System.String)) (Syntax: 'From cust I ... t cust.Name') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select cust.Name') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of Customer).Select(Of System.String)(selector As System.Func(Of Customer, System.String)) As System.Collections.Generic.IEnumerable(Of System.String)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.String)) (Syntax: 'Select cust.Name') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of Customer)) (Syntax: 'cust In customers') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From cust In customers') + ReducedExpression: IParameterReferenceExpression: customers (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.List(Of Customer)) (Syntax: 'customers') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'cust.Name') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of Customer, System.String)) (Syntax: 'cust.Name') + Operand: IPropertyReferenceExpression: Property Customer.Name As System.String (OperationKind.PropertyReferenceExpression, Type: System.String) (Syntax: 'cust.Name') + Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'cust') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs index 70baf65e25392..7c86ef24667c4 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs @@ -6,6 +6,7 @@ using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; +using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; using Xunit; @@ -32,6 +33,48 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[1, 2, 3, 4, 5, 6, 7]"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void FromClause_IOperation() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c = new List() {1, 2, 3, 4, 5, 6, 7}; + var r = /**/from i in c select i/**/; + } +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c select i') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') + ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'i') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [WorkItem(9229, "DevDiv_Projects/Roslyn")] [Fact] public void QueryContinuation() @@ -51,6 +94,64 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[1, 2, 3, 4, 5, 6, 7]"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void QueryContinuation_IOperation() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c = new List() {1, 2, 3, 4, 5, 6, 7}; + var r = /**/from i in c select i into q select q/**/; + } +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c ... q select q') + LastClauseOrContinuation: IQueryContinuation (Declared symbol: ? q) (OperationKind.QueryContinuation) (Syntax: 'into q select q') + Query Body: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select q') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select q') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'select i') + ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') + ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'i') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'q') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'q') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'q') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'q') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'q') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'q') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [WorkItem(9229, "DevDiv_Projects/Roslyn")] [Fact] public void Select() @@ -68,6 +169,50 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[2, 3, 4, 5, 6, 7, 8]"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void SelectClause_IOperation() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c = new List() {1, 2, 3, 4, 5, 6, 7}; + var r = /**/from i in c select i+1/**/; + } +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c select i+1') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i+1') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i+1') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') + ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i+1') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i+1') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i+1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i+1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i+1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i+1') + Left: IOperation: (OperationKind.None) (Syntax: 'i') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [WorkItem(9229, "DevDiv_Projects/Roslyn")] [Fact] public void GroupBy01() @@ -85,6 +230,50 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[1:[1, 3, 5, 7], 0:[2, 4, 6]]"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void GroupByClause_IOperation() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c = new List() {1, 2, 3, 4, 5, 6, 7}; + var r = /**/from i in c group i by i % 2/**/; + } +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable>) (Syntax: 'from i in c ... i by i % 2') + LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'group i by i % 2') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable> System.Linq.Enumerable.GroupBy(this System.Collections.Generic.IEnumerable source, System.Func keySelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable>) (Syntax: 'group i by i % 2') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') + ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'i % 2') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i % 2') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i % 2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i % 2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i % 2') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i % 2') + Left: IOperation: (OperationKind.None) (Syntax: 'i') + Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [WorkItem(9229, "DevDiv_Projects/Roslyn")] [Fact] public void GroupBy02() @@ -118,6 +307,54 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[1, 2, 3, 4, 5, 6, 7]"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void CastInFromClause_IOperation() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c = new List() {1, 2, 3, 4, 5, 6, 7}; + var r = /**/from int i in c select i/**/; + } +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i in c select i') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int i in c') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int i in c') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i in c') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c') + Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'i') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [Fact] public void Where() { @@ -134,6 +371,57 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[1, 2, 3, 4]"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void WhereClause_IOperation() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c = new List() {1, 2, 3, 4, 5, 6, 7}; + var r = /**/from int i in c where i < 5 select i/**/; + } +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i ... 5 select i') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i') + ReducedExpression: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'where i < 5') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Where(this System.Collections.Generic.IEnumerable source, System.Func predicate)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'where i < 5') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int i in c') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int i in c') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i in c') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c') + Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'i < 5') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i < 5') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i < 5') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i < 5') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i < 5') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerLessThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'i < 5') + Left: IOperation: (OperationKind.None) (Syntax: 'i') + Right: ILiteralExpression (Text: 5) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 5) (Syntax: '5') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [WorkItem(9229, "DevDiv_Projects/Roslyn")] [Fact] public void FromJoinSelect() @@ -154,6 +442,79 @@ join x2 in c2 on x1 equals x2/10 CompileAndVerify(csSource, expectedOutput: "[11, 33, 44, 55, 77]"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void FromJoinSelect_IOperation() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c1 = new List() {1, 2, 3, 4, 5, 6, 7}; + List c2 = new List() {10, 30, 40, 50, 60, 70}; + var r = /**/from x1 in c1 + join x2 in c2 on x1 equals x2/10 + select x1+x2/**/; + } +} +"; + // BoundRangeVariable still doesn't have an IOperation API: https://github.com/dotnet/roslyn/issues/21238 + + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in ... elect x1+x2') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x1+x2') + ReducedExpression: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'join x2 in ... quals x2/10') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Join(this System.Collections.Generic.IEnumerable outer, System.Collections.Generic.IEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'join x2 in ... quals x2/10') + Instance Receiver: null + Arguments(5): + IArgument (ArgumentKind.Explicit, Matching Parameter: outer) (OperationKind.Argument) (Syntax: 'from x1 in c1') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in c1') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x1 in c1') + ReducedExpression: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 'x1') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'x1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 'x2/10') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x2/10') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x2/10') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x2/10') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x2/10') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x2/10') + Left: IOperation: (OperationKind.None) (Syntax: 'x2') + Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x1+x2') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1+x2') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1+x2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1+x2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1+x2') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x1+x2') + Left: IOperation: (OperationKind.None) (Syntax: 'x1') + Right: IOperation: (OperationKind.None) (Syntax: 'x2') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [WorkItem(9229, "DevDiv_Projects/Roslyn")] [Fact] public void OrderBy() @@ -174,6 +535,71 @@ from i in c CompileAndVerify(csSource, expectedOutput: "[84, 72, 64, 51, 55, 46, 39, 27, 27, 27, 28]"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void OrderByClause_IOperation() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c = new List() {1, 2, 3, 4, 5, 6, 7}; + var r = /**/from i in c + orderby i/10 descending, i%10 + select i/**/; + } +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'from i in c ... select i') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i') + ReducedExpression: IOrderByQueryClause (Clause kind: OrderByClause) (OperationKind.QueryClause) (Syntax: 'orderby i/1 ... nding, i%10') + ReducedExpression: IOrderingExpression (Order kind: Ascending) (OperationKind.OrderingExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'i%10') + Expression: IInvocationExpression (System.Linq.IOrderedEnumerable System.Linq.Enumerable.ThenBy(this System.Linq.IOrderedEnumerable source, System.Func keySelector)) (OperationKind.InvocationExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'i%10') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'i/10 descending') + IOrderingExpression (Order kind: Descending) (OperationKind.OrderingExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'i/10 descending') + Expression: IInvocationExpression (System.Linq.IOrderedEnumerable System.Linq.Enumerable.OrderByDescending(this System.Collections.Generic.IEnumerable source, System.Func keySelector)) (OperationKind.InvocationExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'i/10 descending') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') + ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'i/10') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i/10') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i/10') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i/10') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i/10') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i/10') + Left: IOperation: (OperationKind.None) (Syntax: 'i') + Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'i%10') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i%10') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i%10') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i%10') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i%10') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i%10') + Left: IOperation: (OperationKind.None) (Syntax: 'i') + Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [WorkItem(9229, "DevDiv_Projects/Roslyn")] [Fact] public void GroupJoin() @@ -195,6 +621,86 @@ join x2 in c2 on x1 equals x2 / 10 into g CompileAndVerify(csSource, expectedOutput: "[1:[12], 2:[], 3:[34], 4:[42], 5:[51, 52], 7:[75]]"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void GroupJoinClause_IOperation() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c1 = new List{1, 2, 3, 4, 5, 7}; + List c2 = new List{12, 34, 42, 51, 52, 66, 75}; + var r = + /**/from x1 in c1 + join x2 in c2 on x1 equals x2 / 10 into g + select x1 + "":"" + g.ToString()/**/; + } +} +"; + // BoundRangeVariable still doesn't have an IOperation API: https://github.com/dotnet/roslyn/issues/21238 + + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in ... .ToString()') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x1 + ... .ToString()') + ReducedExpression: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'join x2 in ... / 10 into g') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.GroupJoin(this System.Collections.Generic.IEnumerable outer, System.Collections.Generic.IEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func, System.String> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'join x2 in ... / 10 into g') + Instance Receiver: null + Arguments(5): + IArgument (ArgumentKind.Explicit, Matching Parameter: outer) (OperationKind.Argument) (Syntax: 'from x1 in c1') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in c1') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x1 in c1') + ReducedExpression: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 'x1') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'x1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 'x2 / 10') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x2 / 10') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x2 / 10') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x2 / 10') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x2 / 10') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x2 / 10') + Left: IOperation: (OperationKind.None) (Syntax: 'x2') + Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'into g') + IJoinIntoQueryClause (Clause kind: JoinIntoClause) (OperationKind.QueryClause) (Syntax: 'into g') + ReducedExpression: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func, System.String>) (Syntax: 'x1 + "":"" + g.ToString()') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1 + "":"" + g.ToString()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1 + "":"" + g.ToString()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1 + "":"" + g.ToString()') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.StringConcatenate) (OperationKind.BinaryOperatorExpression, Type: System.String) (Syntax: 'x1 + "":"" + g.ToString()') + Left: IBinaryOperatorExpression (BinaryOperationKind.StringConcatenate) (OperationKind.BinaryOperatorExpression, Type: System.String) (Syntax: 'x1 + "":""') + Left: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'x1') + Operand: IOperation: (OperationKind.None) (Syntax: 'x1') + Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "":"") (Syntax: '"":""') + Right: IInvocationExpression (virtual System.String System.Object.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'g.ToString()') + Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'g') + Arguments(0) + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [WorkItem(9229, "DevDiv_Projects/Roslyn")] [Fact] public void SelectMany01() @@ -213,6 +719,62 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[11, 21, 31, 12, 22, 32, 13, 23, 33]"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void SelectMany_IOperation() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c1 = new List{1, 2, 3, 4, 5, 7}; + List c2 = new List{12, 34, 42, 51, 52, 66, 75}; + var r = /**/from x in c1 from y in c2 select x + y/**/; + } +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in c ... elect x + y') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x + y') + ReducedExpression: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from y in c2') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.SelectMany(this System.Collections.Generic.IEnumerable source, System.Func> collectionSelector, System.Func resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from y in c2') + Instance Receiver: null + Arguments(3): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from x in c1') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in c1') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in c1') + ReducedExpression: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'from y in c2') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from y in c2') + ReducedExpression: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c2') + ReturnedValue: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x + y') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x + y') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IOperation: (OperationKind.None) (Syntax: 'y') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [WorkItem(9229, "DevDiv_Projects/Roslyn")] [Fact] public void SelectMany02() @@ -252,6 +814,115 @@ from int x in c1 CompileAndVerify(csSource, expectedOutput: "[111, 222, 333]"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void LetClause_IOperation() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c1 = new List{1, 2, 3, 4, 5, 7}; + var r = /**/from int x in c1 + let g = x * 10 + let z = g + x*100 + select x + z/**/; + } +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x ... elect x + z') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x + z') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select< <>h__TransparentIdentifier0, System.Int32 z>, System.Int32>(this System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>> source, System.Func< <>h__TransparentIdentifier0, System.Int32 z>, System.Int32> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select x + z') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let z = g + x*100') + ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'let z = g + x*100') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>> System.Linq.Enumerable.Select<, <>h__TransparentIdentifier0, System.Int32 z>>(this System.Collections.Generic.IEnumerable<> source, System.Func<, <>h__TransparentIdentifier0, System.Int32 z>> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'let z = g + x*100') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let g = x * 10') + ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'let g = x * 10') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'let g = x * 10') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int x in c1') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int x in c1') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x in c1') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c1') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') + Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x * 10') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x * 10') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x * 10') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x * 10') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x * 10') + ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Int32 x, System.Int32 g)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'let g = x * 10') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'let g = x * 10') + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'let g = x * 10') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: g) (OperationKind.Argument) (Syntax: 'x * 10') + IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x * 10') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'g + x*100') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'g + x*100') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'g + x*100') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'g + x*100') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'g + x*100') + ReturnedValue: IObjectCreationExpression (Constructor: <>h__TransparentIdentifier0, System.Int32 z>..ctor( <>h__TransparentIdentifier0, System.Int32 z)) (OperationKind.ObjectCreationExpression, Type: <>h__TransparentIdentifier0, System.Int32 z>) (Syntax: 'let z = g + x*100') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: <>h__TransparentIdentifier0) (OperationKind.Argument) (Syntax: 'let z = g + x*100') + IParameterReferenceExpression: <>h__TransparentIdentifier0 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'let z = g + x*100') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'g + x*100') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'g + x*100') + Left: IOperation: (OperationKind.None) (Syntax: 'g') + Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x*100') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: ILiteralExpression (Text: 100) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 100) (Syntax: '100') + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + z') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z>, System.Int32>) (Syntax: 'x + z') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + z') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + z') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + z') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + z') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IOperation: (OperationKind.None) (Syntax: 'z') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [WorkItem(9229, "DevDiv_Projects/Roslyn")] [Fact] public void TransparentIdentifiers_FromLet() @@ -278,6 +949,197 @@ from int z in c3 CompileAndVerify(csSource, expectedOutput: "[111, 211, 311, 121, 221, 131, 112, 212, 122, 113]"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void TransparentIdentifiers_FromLet_IOperation() + { + string source = @" +using C = System.Collections.Generic.List; +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + C c1 = new C{1, 2, 3}; + C c2 = new C{10, 20, 30}; + C c3 = new C{100, 200, 300}; + var r1 = + /**/from int x in c1 + from int y in c2 + from int z in c3 + let g = x + y + z + where (x + y / 10 + z / 100) < 6 + select g/**/; + } +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x ... select g') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select g') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Int32>(this System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> source, System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Int32> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select g') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'where (x + ... / 100) < 6') + IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'where (x + ... / 100) < 6') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> System.Linq.Enumerable.Where< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>(this System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> source, System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Boolean> predicate)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>) (Syntax: 'where (x + ... / 100) < 6') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let g = x + y + z') + ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'let g = x + y + z') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> System.Linq.Enumerable.Select< <>h__TransparentIdentifier0, System.Int32 z>, <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>(this System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>> source, System.Func< <>h__TransparentIdentifier0, System.Int32 z>, <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>) (Syntax: 'let g = x + y + z') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int z in c3') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int z in c3') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>> System.Linq.Enumerable.SelectMany<, System.Int32, <>h__TransparentIdentifier0, System.Int32 z>>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.Collections.Generic.IEnumerable> collectionSelector, System.Func<, System.Int32, <>h__TransparentIdentifier0, System.Int32 z>> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'from int z in c3') + Instance Receiver: null + Arguments(3): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int y in c2') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int y in c2') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.SelectMany>(this System.Collections.Generic.IEnumerable source, System.Func> collectionSelector, System.Func> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'from int y in c2') + Instance Receiver: null + Arguments(3): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int x in c1') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int x in c1') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x in c1') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c1') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') + Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c2') + ReturnedValue: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c2') + Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'from int y in c2') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'from int y in c2') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from int y in c2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from int y in c2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from int y in c2') + ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Int32 x, System.Int32 y)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'from int y in c2') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'from int y in c2') + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int y in c2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'from int y in c2') + IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int y in c2') + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c3') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, System.Collections.Generic.IEnumerable>) (Syntax: 'c3') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c3') + ReturnedValue: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c3') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c3') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c3') + Operand: ILocalReferenceExpression: c3 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c3') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'from int z in c3') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, System.Int32, <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'from int z in c3') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from int z in c3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from int z in c3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from int z in c3') + ReturnedValue: IObjectCreationExpression (Constructor: <>h__TransparentIdentifier0, System.Int32 z>..ctor( <>h__TransparentIdentifier0, System.Int32 z)) (OperationKind.ObjectCreationExpression, Type: <>h__TransparentIdentifier0, System.Int32 z>) (Syntax: 'from int z in c3') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: <>h__TransparentIdentifier0) (OperationKind.Argument) (Syntax: 'from int z in c3') + IParameterReferenceExpression: <>h__TransparentIdentifier0 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'from int z in c3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'from int z in c3') + IParameterReferenceExpression: z (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int z in c3') + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + y + z') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z>, <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>) (Syntax: 'x + y + z') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y + z') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y + z') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y + z') + ReturnedValue: IObjectCreationExpression (Constructor: <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>..ctor( <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g)) (OperationKind.ObjectCreationExpression, Type: <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>) (Syntax: 'let g = x + y + z') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: <>h__TransparentIdentifier1) (OperationKind.Argument) (Syntax: 'let g = x + y + z') + IParameterReferenceExpression: <>h__TransparentIdentifier1 (OperationKind.ParameterReferenceExpression, Type: <>h__TransparentIdentifier0, System.Int32 z>) (Syntax: 'let g = x + y + z') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: g) (OperationKind.Argument) (Syntax: 'x + y + z') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y + z') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IOperation: (OperationKind.None) (Syntax: 'y') + Right: IOperation: (OperationKind.None) (Syntax: 'z') + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: '(x + y / 10 ... / 100) < 6') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Boolean>) (Syntax: '(x + y / 10 ... / 100) < 6') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '(x + y / 10 ... / 100) < 6') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '(x + y / 10 ... / 100) < 6') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '(x + y / 10 ... / 100) < 6') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerLessThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '(x + y / 10 ... / 100) < 6') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y / 10 + z / 100') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y / 10') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'y / 10') + Left: IOperation: (OperationKind.None) (Syntax: 'y') + Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'z / 100') + Left: IOperation: (OperationKind.None) (Syntax: 'z') + Right: ILiteralExpression (Text: 100) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 100) (Syntax: '100') + Right: ILiteralExpression (Text: 6) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: '6') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'g') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Int32>) (Syntax: 'g') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'g') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'g') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'g') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'g') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [WorkItem(9229, "DevDiv_Projects/Roslyn")] [Fact] public void TransparentIdentifiers_Join01() @@ -419,6 +1281,122 @@ from int z in c3 Assert.Equal(z, model.GetSemanticInfoSummary(xPyPz.Right).Symbol); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void RangeVariables_IOperation() + { + string source = @" +using C = System.Collections.Generic.List; +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + C c1 = new C{1, 2, 3}; + C c2 = new C{10, 20, 30}; + C c3 = new C{100, 200, 300}; + var r1 = + /**/from int x in c1 + from int y in c2 + from int z in c3 + select x + y + z/**/; + } +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x ... t x + y + z') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x + y + z') + ReducedExpression: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int z in c3') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.SelectMany<, System.Int32, System.Int32>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.Collections.Generic.IEnumerable> collectionSelector, System.Func<, System.Int32, System.Int32> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int z in c3') + Instance Receiver: null + Arguments(3): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int y in c2') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int y in c2') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.SelectMany>(this System.Collections.Generic.IEnumerable source, System.Func> collectionSelector, System.Func> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'from int y in c2') + Instance Receiver: null + Arguments(3): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int x in c1') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int x in c1') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x in c1') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c1') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') + Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c2') + ReturnedValue: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c2') + Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'from int y in c2') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'from int y in c2') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from int y in c2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from int y in c2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from int y in c2') + ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Int32 x, System.Int32 y)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'from int y in c2') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'from int y in c2') + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int y in c2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'from int y in c2') + IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int y in c2') + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'from int z in c3') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int z in c3') + ReducedExpression: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, System.Collections.Generic.IEnumerable>) (Syntax: 'c3') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c3') + ReturnedValue: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c3') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c3') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c3') + Operand: ILocalReferenceExpression: c3 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c3') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x + y + z') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, System.Int32, System.Int32>) (Syntax: 'x + y + z') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y + z') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y + z') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y + z') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y + z') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IOperation: (OperationKind.None) (Syntax: 'y') + Right: IOperation: (OperationKind.None) (Syntax: 'z') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [Fact] public void RangeVariables02() { @@ -570,47 +1548,147 @@ from i in c [Fact] public void MultipleFromClauseIdentifierInExprNotInContext() { - var csSource = @" + string source = @" +using System.Linq; + class Program { static void Main(string[] args) { - var q2 = from n1 in nums + var q2 = /**/from n1 in nums from n2 in nums - select n1; + select n1/**/; } -}"; - CreateCompilationWithMscorlibAndSystemCore(csSource).VerifyDiagnostics( - // (6,29): error CS0103: The name 'nums' does not exist in the current context - Diagnostic(ErrorCode.ERR_NameNotInContext, "nums").WithArguments("nums") - ); +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'from n1 in ... select n1') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select n1') + ReducedExpression: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from n2 in nums') + ReducedExpression: IInvocationExpression (? Program.SelectMany()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'from n2 in nums') + Instance Receiver: null + Arguments(3): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from n1 in nums') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from n1 in nums') + ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'nums') + Children(0) + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from n2 in nums') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from n2 in nums') + ReducedExpression: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'nums') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'nums') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'nums') + ReturnedValue: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'nums') + Children(0) + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'n1') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'n1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'n1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'n1') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'n1') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = new DiagnosticDescription[] { + // CS0103: The name 'nums' does not exist in the current context + // var q2 = /**/from n1 in nums + Diagnostic(ErrorCode.ERR_NameNotInContext, "nums").WithArguments("nums").WithLocation(8, 39), + // CS0103: The name 'nums' does not exist in the current context + // from n2 in nums + Diagnostic(ErrorCode.ERR_NameNotInContext, "nums").WithArguments("nums").WithLocation(9, 29) + }; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } [WorkItem(541906, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541906")] [Fact] public void NullLiteralFollowingJoinInQuery() { - var csSource = @" + string source = @" using System.Linq; class Program { static void Main(string[] args) { - var query = from int i in new int[]{ 1 } join null on true equals true select i; //CS1031 + var query = /**/from int i in new int[] { 1 } join null on true equals true select i/**/; //CS1031 } -}"; - CreateCompilationWithMscorlibAndSystemCore(csSource).VerifyDiagnostics( - // (8,55): error CS1031: Type expected - // var query = from int i in new int[]{ 1 } join null on true equals true select i; //CS1031 - Diagnostic(ErrorCode.ERR_TypeExpected, "null"), - // (8,55): error CS1001: Identifier expected - // var query = from int i in new int[]{ 1 } join null on true equals true select i; //CS1031 - Diagnostic(ErrorCode.ERR_IdentifierExpected, "null"), - // (8,55): error CS1003: Syntax error, 'in' expected - // var query = from int i in new int[]{ 1 } join null on true equals true select i; //CS1031 - Diagnostic(ErrorCode.ERR_SyntaxError, "null").WithArguments("in", "null") - ); +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'from int i ... ue select i') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i') + ReducedExpression: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'join null o ... equals true') + ReducedExpression: IInvocationExpression (? Program.Join()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'join null o ... equals true') + Instance Receiver: null + Arguments(5): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'from int i ... int[] { 1 }') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int i ... int[] { 1 }') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i ... int[] { 1 }') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'new int[] { 1 }') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'new int[] { 1 }') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32[]) (Syntax: 'new int[] { 1 }') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'new int[] { 1 }') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{ 1 }') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'join null o ... equals true') + IInvocationExpression (? Program.Cast()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'join null o ... equals true') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'null') + IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'null') + Children(1): + ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null, IsInvalid) (Syntax: 'null') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'true') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'true') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'true') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'true') + ReturnedValue: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'true') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'true') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'true') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'true') + ReturnedValue: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'i') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'i') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = new DiagnosticDescription[] { + // CS1031: Type expected + // var query = /**/from int i in new int[] { 1 } join null on true equals true select i/**/; //CS1031 + Diagnostic(ErrorCode.ERR_TypeExpected, "null").WithLocation(8, 66), + // CS1001: Identifier expected + // var query = /**/from int i in new int[] { 1 } join null on true equals true select i/**/; //CS1031 + Diagnostic(ErrorCode.ERR_IdentifierExpected, "null").WithLocation(8, 66), + // CS1003: Syntax error, 'in' expected + // var query = /**/from int i in new int[] { 1 } join null on true equals true select i/**/; //CS1031 + Diagnostic(ErrorCode.ERR_SyntaxError, "null").WithArguments("in", "null").WithLocation(8, 66) + }; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } [WorkItem(541779, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541779")] @@ -700,6 +1778,99 @@ join b in Enumerable.Range(1, 13) on 4 * a equals b CompileAndVerify(csSource, additionalRefs: new[] { LinqAssemblyRef }, expectedOutput: "1 2 3"); } + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void JoinClause_IOperation() + { + string source = @" +using System; +using System.Linq; + +class Program +{ + static void Main() + { + var q2 = + /**/from a in Enumerable.Range(1, 13) + join b in Enumerable.Range(1, 13) on 4 * a equals b + select a/**/; + + string serializer = String.Empty; + foreach (var q in q2) + { + serializer = serializer + q + "" ""; + } + System.Console.Write(serializer.Trim()); + } +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from a in E ... select a') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select a') + ReducedExpression: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'join b in E ... a equals b') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Join(this System.Collections.Generic.IEnumerable outer, System.Collections.Generic.IEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'join b in E ... a equals b') + Instance Receiver: null + Arguments(5): + IArgument (ArgumentKind.Explicit, Matching Parameter: outer) (OperationKind.Argument) (Syntax: 'from a in E ... ange(1, 13)') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from a in E ... ange(1, 13)') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Range(System.Int32 start, System.Int32 count)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'Enumerable.Range(1, 13)') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: start) (OperationKind.Argument) (Syntax: '1') + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: count) (OperationKind.Argument) (Syntax: '13') + ILiteralExpression (Text: 13) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 13) (Syntax: '13') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'Enumerable.Range(1, 13)') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Range(System.Int32 start, System.Int32 count)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'Enumerable.Range(1, 13)') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: start) (OperationKind.Argument) (Syntax: '1') + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: count) (OperationKind.Argument) (Syntax: '13') + ILiteralExpression (Text: 13) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 13) (Syntax: '13') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: '4 * a') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: '4 * a') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '4 * a') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '4 * a') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '4 * a') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '4 * a') + Left: ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + Right: IOperation: (OperationKind.None) (Syntax: 'a') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 'b') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'b') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'b') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'b') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'b') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'b') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'a') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'a') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'a') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'a') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'a') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'a') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + [WorkItem(541789, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541789")] [WorkItem(9229, "DevDiv_Projects/Roslyn")] [Fact] @@ -1357,7 +2528,7 @@ class P [Fact] public void StaticTypeInFromClause() { - string sourceCode = @" + string source = @" using System; using System.Linq; @@ -1366,42 +2537,97 @@ class C static void Main() { var q2 = string.Empty.Cast().Select(x => x); - var q1 = from GC x in string.Empty select x; + var q1 = /**/from GC x in string.Empty select x/**/; } -}"; - var compilation = CreateCompilationWithMscorlibAndSystemCore(sourceCode); - compilation.VerifyDiagnostics( - // (9,18): error CS0718: 'GC': static types cannot be used as type arguments +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'from GC x i ... ty select x') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x') + ReducedExpression: IInvocationExpression (? C.Select()) (OperationKind.InvocationExpression, Type: ?) (Syntax: 'select x') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from GC x i ... tring.Empty') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from GC x i ... tring.Empty') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable, IsInvalid) (Syntax: 'from GC x i ... tring.Empty') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'string.Empty') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable, IsInvalid) (Syntax: 'string.Empty') + Operand: IFieldReferenceExpression: System.String System.String.Empty (Static) (OperationKind.FieldReferenceExpression, Type: System.String, IsInvalid) (Syntax: 'string.Empty') + Instance Receiver: null + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'x') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'x') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = new DiagnosticDescription[] { + // CS0718: 'GC': static types cannot be used as type arguments // var q2 = string.Empty.Cast().Select(x => x); Diagnostic(ErrorCode.ERR_GenericArgIsStaticClass, "string.Empty.Cast").WithArguments("System.GC").WithLocation(9, 18), - // (10,18): error CS0718: 'GC': static types cannot be used as type arguments - // var q1 = from GC x in string.Empty select x; - Diagnostic(ErrorCode.ERR_GenericArgIsStaticClass, "from GC x in string.Empty").WithArguments("System.GC").WithLocation(10, 18) - ); + // CS0718: 'GC': static types cannot be used as type arguments + // var q1 = /**/from GC x in string.Empty select x/**/; + Diagnostic(ErrorCode.ERR_GenericArgIsStaticClass, "from GC x in string.Empty").WithArguments("System.GC").WithLocation(10, 28) + }; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } [WorkItem(542560, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542560")] [Fact] public void MethodGroupInFromClause() { - string sourceCode = @" + string source = @" +using System; +using System.Linq; + class Program { static void Main() { - var q1 = from y in Main select y; + var q1 = /**/from y in Main select y/**/; var q2 = Main.Select(y => y); } -}"; - var compilation = CreateCompilationWithMscorlibAndSystemCore(sourceCode); - compilation.VerifyDiagnostics( - // (6,28): error CS0119: 'Program.Main()' is a method, which is not valid in the given context - // var q1 = from y in Main select y; - Diagnostic(ErrorCode.ERR_BadSKunknown, "Main").WithArguments("Program.Main()", "method").WithLocation(6, 28), - // (7,18): error CS0119: 'Program.Main()' is a method, which is not valid in the given context +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'from y in Main select y') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select y') + ReducedExpression: IInvocationExpression (? Program.Select()) (OperationKind.InvocationExpression, Type: ?) (Syntax: 'select y') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from y in Main') + IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'from y in Main') + Children(1): + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from y in Main') + ReducedExpression: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Main') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'y') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'y') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'y') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'y') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'y') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = new DiagnosticDescription[] { + // CS0119: 'Program.Main()' is a method, which is not valid in the given context + // var q1 = /**/from y in Main select y/**/; + Diagnostic(ErrorCode.ERR_BadSKunknown, "Main").WithArguments("Program.Main()", "method").WithLocation(9, 38), + // CS0119: 'Program.Main()' is a method, which is not valid in the given context // var q2 = Main.Select(y => y); - Diagnostic(ErrorCode.ERR_BadSKunknown, "Main").WithArguments("Program.Main()", "method").WithLocation(7, 18) - ); + Diagnostic(ErrorCode.ERR_BadSKunknown, "Main").WithArguments("Program.Main()", "method").WithLocation(10, 18) + }; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } [WorkItem(542558, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542558")] @@ -1548,8 +2774,8 @@ static int Main() [Fact] public void RangeTypeAlreadySpecified() { - string sourceCode = -@"using System.Linq; + string source = @" +using System.Linq; using System.Collections; static class Test @@ -1557,21 +2783,46 @@ static class Test public static void Main2() { var list = new CastableToArrayList(); - var q = from int x in list - select x + 1; + var q = /**/from int x in list + select x + 1/**/; } } class CastableToArrayList { public ArrayList Cast() { return null; } -}"; - var compilation = CreateCompilationWithMscorlibAndSystemCore(sourceCode); - compilation.VerifyDiagnostics( - // (9,31): error CS1936: Could not find an implementation of the query pattern for source type 'System.Collections.ArrayList'. 'Select' not found. - // var q = from int x in list - Diagnostic(ErrorCode.ERR_QueryNoProvider, "list").WithArguments("System.Collections.ArrayList", "Select") - ); +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'from int x ... elect x + 1') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x + 1') + ReducedExpression: IInvocationExpression (? Test.Select()) (OperationKind.InvocationExpression, Type: ?) (Syntax: 'select x + 1') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from int x in list') + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from int x in list') + ReducedExpression: IInvocationExpression ( System.Collections.ArrayList CastableToArrayList.Cast()) (OperationKind.InvocationExpression, Type: System.Collections.ArrayList, IsInvalid) (Syntax: 'from int x in list') + Instance Receiver: ILocalReferenceExpression: list (OperationKind.LocalReferenceExpression, Type: CastableToArrayList, IsInvalid) (Syntax: 'list') + Arguments(0) + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'x + 1') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + 1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.Invalid) (OperationKind.BinaryOperatorExpression, Type: ?) (Syntax: 'x + 1') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = new DiagnosticDescription[] { + // CS1936: Could not find an implementation of the query pattern for source type 'ArrayList'. 'Select' not found. + // var q = /**/from int x in list + Diagnostic(ErrorCode.ERR_QueryNoProvider, "list").WithArguments("System.Collections.ArrayList", "Select").WithLocation(10, 41) + }; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } [WorkItem(11414, "DevDiv_Projects/Roslyn")] @@ -1652,12 +2903,13 @@ public static void Main () [Fact] public void QueryOnNull() { - string source = @"using System; + string source = @" +using System; static class C { static void Main() { - var q = from x in null select x; + var q = /**/from x in null select x/**/; } static object Select(this object x, Func y) @@ -1666,24 +2918,47 @@ static object Select(this object x, Func y) } } "; - var compilation = CreateCompilationWithMscorlibAndSystemCore(source); - compilation.VerifyDiagnostics( - // (6,32): error CS0186: Use of null is not valid in this context - // var q = from x in null select x; - Diagnostic(ErrorCode.ERR_NullNotValid, "select x") - ); + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Object, IsInvalid) (Syntax: 'from x in null select x') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'select x') + ReducedExpression: IInvocationExpression (System.Object C.Select(this System.Object x, System.Func y)) (OperationKind.InvocationExpression, Type: System.Object, IsInvalid) (Syntax: 'select x') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'from x in null') + IInvalidExpression (OperationKind.InvalidExpression, Type: ?) (Syntax: 'from x in null') + Children(1): + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in null') + ReducedExpression: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'x') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'x') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'x') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'x') + ReturnedValue: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'x') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = new DiagnosticDescription[] { + // CS0186: Use of null is not valid in this context + // var q = /**/from x in null select x/**/; + Diagnostic(ErrorCode.ERR_NullNotValid, "select x").WithLocation(7, 42) + }; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } [WorkItem(545797, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545797")] [Fact] public void QueryOnLambda() { - string source = @"using System; + string source = @" +using System; static class C { static void Main() { - var q = from x in y=>y select x; + var q = /**/from x in y => y select x/**/; } static object Select(this object x, Func y) @@ -1692,12 +2967,37 @@ static object Select(this object x, Func y) } } "; - var compilation = CreateCompilationWithMscorlibAndSystemCore(source); - compilation.VerifyDiagnostics( - // (6,32): error CS1936: Could not find an implementation of the query pattern for source type 'anonymous method'. 'Select' not found. - // var q = from x in y=>y select x; - Diagnostic(ErrorCode.ERR_QueryNoProvider, "select x").WithArguments("anonymous method", "Select") - ); + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Object, IsInvalid) (Syntax: 'from x in y ... y select x') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'select x') + ReducedExpression: IInvocationExpression (System.Object C.Select(this System.Object x, System.Func y)) (OperationKind.InvocationExpression, Type: System.Object, IsInvalid) (Syntax: 'select x') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'from x in y => y') + IInvalidExpression (OperationKind.InvalidExpression, Type: ?) (Syntax: 'from x in y => y') + Children(1): + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in y => y') + ReducedExpression: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'y => y') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'y') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'y') + ReturnedValue: IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: ?) (Syntax: 'y') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'x') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'x') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'x') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'x') + ReturnedValue: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'x') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = new DiagnosticDescription[] { + // CS1936: Could not find an implementation of the query pattern for source type 'anonymous method'. 'Select' not found. + // var q = /**/from x in y => y select x/**/; + Diagnostic(ErrorCode.ERR_QueryNoProvider, "select x").WithArguments("anonymous method", "Select").WithLocation(7, 44) + }; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } [WorkItem(545444, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545444")] @@ -2059,8 +3359,8 @@ x descending [Fact] public void BrokenQueryPattern() { - string sourceCode = -@"using System; + string source = @" +using System; class Q { @@ -2082,17 +3382,83 @@ static void Main(string[] args) { Q q = null; var r = - from x in q + /**/from x in q from y in q where x.ToString() == y.ToString() - select x.ToString(); + select x.ToString()/**/; } -}"; - CreateCompilationWithMscorlibAndSystemCore(sourceCode).VerifyDiagnostics( - // (26,20): error CS8016: Transparent identifier member access failed for field 'x' of 'int'. Does the data being queried implement the query pattern? - // select x.ToString(); - Diagnostic(ErrorCode.ERR_UnsupportedTransparentIdentifierAccess, "x").WithArguments("x", "int") - ); +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: X, IsInvalid) (Syntax: 'from x in q ... .ToString()') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'select x.ToString()') + ReducedExpression: IInvocationExpression ( X X.Select(System.Func f1)) (OperationKind.InvocationExpression, Type: X, IsInvalid) (Syntax: 'select x.ToString()') + Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'where x.ToS ... .ToString()') + ReducedExpression: IInvocationExpression ( X Q< y>>.Where(System.Func< y>, System.Boolean> f1)) (OperationKind.InvocationExpression, Type: X) (Syntax: 'where x.ToS ... .ToString()') + Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from y in q') + ReducedExpression: IInvocationExpression ( Q< y>> Q.SelectMany, y>>(System.Func> f1, System.Func, y>> f2)) (OperationKind.InvocationExpression, Type: Q< y>>) (Syntax: 'from y in q') + Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in q') + ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: Q) (Syntax: 'q') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: f1) (OperationKind.Argument) (Syntax: 'q') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'q') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'q') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'q') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'q') + ReturnedValue: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: Q) (Syntax: 'q') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: f2) (OperationKind.Argument) (Syntax: 'from y in q') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func, y>>) (Syntax: 'from y in q') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from y in q') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from y in q') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from y in q') + ReturnedValue: IObjectCreationExpression (Constructor: y>..ctor(System.Int32 x, Q y)) (OperationKind.ObjectCreationExpression, Type: y>) (Syntax: 'from y in q') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'from y in q') + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from y in q') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'from y in q') + IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: Q) (Syntax: 'from y in q') + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: f1) (OperationKind.Argument) (Syntax: 'x.ToString( ... .ToString()') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func< y>, System.Boolean>) (Syntax: 'x.ToString( ... .ToString()') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x.ToString( ... .ToString()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x.ToString( ... .ToString()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x.ToString( ... .ToString()') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.StringEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'x.ToString( ... .ToString()') + Left: IInvocationExpression (virtual System.String System.Int32.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'x.ToString()') + Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'x') + Arguments(0) + Right: IInvocationExpression (virtual System.String System.Object.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'y.ToString()') + Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'y') + Arguments(0) + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'x.ToString()') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'x.ToString()') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'x.ToString()') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'x.ToString()') + ReturnedValue: IInvocationExpression ( ? Program.()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'x.ToString()') + Instance Receiver: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'x.ToString') + Arguments(0) + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = new DiagnosticDescription[] { + // CS8016: Transparent identifier member access failed for field 'x' of 'int'. Does the data being queried implement the query pattern? + // select x.ToString()/**/; + Diagnostic(ErrorCode.ERR_UnsupportedTransparentIdentifierAccess, "x").WithArguments("x", "int").WithLocation(27, 20) + }; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } [Fact] @@ -2469,7 +3835,7 @@ public ValueTuple(T1 item1, T2 item2) [Fact, WorkItem(14689, "https://github.com/dotnet/roslyn/issues/14689")] public void SelectFromNamespaceShouldGiveAnError() { - var code = @" + string source = @" using System.Linq; using NSAlias = ParentNamespace.ConsoleApp; @@ -2483,28 +3849,52 @@ static void Main() { var x = from c in ConsoleApp select 3; var y = from c in ParentNamespace.ConsoleApp select 3; - var z = from c in NSAlias select 3; + var z = /**/from c in NSAlias select 3/**/; } } } -}"; - - CreateCompilationWithMscorlibAndSystemCore(code).VerifyDiagnostics( - // (13,35): error CS0119: 'ConsoleApp' is a namespace, which is not valid in the given context +} +"; + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'from c in N ... as select 3') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select 3') + ReducedExpression: IInvocationExpression (? ParentNamespace.ConsoleApp.Program.Select()) (OperationKind.InvocationExpression, Type: ?) (Syntax: 'select 3') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from c in NSAlias') + IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'from c in NSAlias') + Children(1): + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from c in NSAlias') + ReducedExpression: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'NSAlias') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: '3') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '3') + ReturnedValue: ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = new DiagnosticDescription[] { + // CS0119: 'ConsoleApp' is a namespace, which is not valid in the given context // var x = from c in ConsoleApp select 3; Diagnostic(ErrorCode.ERR_BadSKunknown, "ConsoleApp").WithArguments("ConsoleApp", "namespace").WithLocation(13, 35), - // (14,35): error CS0119: 'ParentNamespace.ConsoleApp' is a namespace, which is not valid in the given context + // CS0119: 'ParentNamespace.ConsoleApp' is a namespace, which is not valid in the given context // var y = from c in ParentNamespace.ConsoleApp select 3; Diagnostic(ErrorCode.ERR_BadSKunknown, "ParentNamespace.ConsoleApp").WithArguments("ParentNamespace.ConsoleApp", "namespace").WithLocation(14, 35), - // (15,35): error CS0119: 'NSAlias' is a namespace, which is not valid in the given context - // var z = from c in NSAlias select 3; - Diagnostic(ErrorCode.ERR_BadSKunknown, "NSAlias").WithArguments("NSAlias", "namespace").WithLocation(15, 35)); + // CS0119: 'NSAlias' is a namespace, which is not valid in the given context + // var z = /**/from c in NSAlias select 3/**/; + Diagnostic(ErrorCode.ERR_BadSKunknown, "NSAlias").WithArguments("NSAlias", "namespace").WithLocation(15, 45) + }; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } [Fact, WorkItem(12052, "https://github.com/dotnet/roslyn/issues/12052")] public void LambdaParameterConflictsWithRangeVariable() { - var code = @" + string source = @" using System; using System.Linq; @@ -2512,16 +3902,48 @@ class Program { static void Main() { - var res = from a in new[] { 1 } - select (Func)(a => 1); + var res = /**/from a in new[] { 1 } + select (Func)(a => 1)/**/; } } "; - CreateCompilationWithMscorlibAndSystemCore(code).VerifyDiagnostics( - // (10,43): error CS0136: A local or parameter named 'a' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter - // select (Func)(a => 1); + string expectedOperationTree = @" +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable>, IsInvalid) (Syntax: 'from a in n ... t>)(a => 1)') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'select (Fun ... t>)(a => 1)') + ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable>, IsInvalid) (Syntax: 'select (Fun ... t>)(a => 1)') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from a in new[] { 1 }') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from a in new[] { 1 }') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from a in new[] { 1 }') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32[]) (Syntax: 'new[] { 1 }') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'new[] { 1 }') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{ 1 }') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument, IsInvalid) (Syntax: '(Func)(a => 1)') + IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>, IsInvalid) (Syntax: '(Func)(a => 1)') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: '(Func)(a => 1)') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: '(Func)(a => 1)') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: '(Func)(a => 1)') + ReturnedValue: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Func, IsInvalid) (Syntax: '(Func)(a => 1)') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'a => 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '1') + ReturnedValue: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = new DiagnosticDescription[] { + // CS0136: A local or parameter named 'a' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter + // select (Func)(a => 1)/**/; Diagnostic(ErrorCode.ERR_LocalIllegallyOverrides, "a").WithArguments("a").WithLocation(10, 43) - ); + }; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } } } diff --git a/src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs b/src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs index f2ff8f13f9bb5..e0c6555ca305f 100644 --- a/src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs +++ b/src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs @@ -6075,4 +6075,912 @@ public LazyCollectionElementInitializerExpression(IMethodSymbol addMethod, Lazy< /// public override ImmutableArray Arguments => _lazyArguments.Value; } + + /// + /// Represents a query expression in C# or VB. + /// + internal abstract partial class BaseQueryExpression : Operation, IQueryExpression + { + protected BaseQueryExpression(SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(OperationKind.QueryExpression, syntax, type, constantValue) + { + } + /// + /// Last or in the unrolled query expression. + /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, + /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. + /// + public abstract IOperation LastClauseOrContinuation { get; } + public override IEnumerable Children + { + get + { + yield return LastClauseOrContinuation; + } + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitQueryExpression(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitQueryExpression(this, argument); + } + } + + /// + /// Represents a query expression in C# or VB. + /// + internal sealed partial class QueryExpression : BaseQueryExpression, IQueryExpression + { + public QueryExpression(IOperation lastClauseOrContinuation, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(syntax, type, constantValue) + { + LastClauseOrContinuation = lastClauseOrContinuation; + } + /// + /// Last or in the unrolled query expression. + /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, + /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. + /// + public override IOperation LastClauseOrContinuation { get; } + } + + /// + /// Represents a query expression in C# or VB. + /// + internal sealed partial class LazyQueryExpression : BaseQueryExpression, IQueryExpression + { + private readonly Lazy _lazyLastClauseOrContinuation; + + public LazyQueryExpression(Lazy lastClauseOrContinuation, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(syntax, type, constantValue) + { + _lazyLastClauseOrContinuation = lastClauseOrContinuation ?? throw new System.ArgumentNullException(nameof(lastClauseOrContinuation)); + } + /// + /// Last or in the unrolled query expression. + /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, + /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. + /// + public override IOperation LastClauseOrContinuation => _lazyLastClauseOrContinuation.Value; + } + + /// + /// Represents an ordering expression within an in C# or VB. + /// + internal abstract partial class BaseOrderingExpression : Operation, IOrderingExpression + { + protected BaseOrderingExpression(OrderKind orderKind, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(OperationKind.OrderingExpression, syntax, type, constantValue) + { + OrderKind = orderKind; + } + /// + /// for the ordering expression. + /// + public OrderKind OrderKind { get; } + /// + /// Underlying ordering expression for the order by query clause. + /// + public abstract IOperation Expression { get; } + public override IEnumerable Children + { + get + { + yield return Expression; + } + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitOrderingExpression(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitOrderingExpression(this, argument); + } + } + + /// + /// Represents an ordering expression within an in C# or VB. + /// + internal sealed partial class OrderingExpression : BaseOrderingExpression, IOrderingExpression + { + public OrderingExpression(IOperation expression, OrderKind orderKind, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(orderKind, syntax, type, constantValue) + { + Expression = expression; + } + /// + /// Underlying ordering expression for the order by query clause. + /// + public override IOperation Expression { get; } + } + + /// + /// Represents an ordering expression within an in C# or VB. + /// + internal sealed partial class LazyOrderingExpression : BaseOrderingExpression, IOrderingExpression + { + private readonly Lazy _lazyExression; + + public LazyOrderingExpression(Lazy expression, OrderKind orderKind, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(orderKind, syntax, type, constantValue) + { + _lazyExression = expression ?? throw new System.ArgumentNullException(nameof(expression)); + } + /// + /// Underlying ordering expression for the order by query clause. + /// + public override IOperation Expression => _lazyExression.Value; + } + + /// + /// Represents a group or function aggregation expression inside an Into clause of a Group By or Aggregate query clause in VB. + /// + internal abstract partial class BaseAggregationExpression : Operation, IAggregationExpression + { + protected BaseAggregationExpression(bool isGroupAggregation, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(OperationKind.AggregationExpression, syntax, type, constantValue) + { + IsGroupAggregation = isGroupAggregation; + } + /// + /// Flag indicating if this is a group aggregation clause. + /// + public bool IsGroupAggregation { get; } + /// + /// Aggregation expression. + /// + public abstract IOperation Expression { get; } + public override IEnumerable Children + { + get + { + yield return Expression; + } + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitAggregationExpression(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitAggregationExpression(this, argument); + } + } + + /// + /// Represents a group or function aggregation expression inside an Into clause of a Group By or Aggregate query clause in VB. + /// + internal sealed partial class AggregationExpression : BaseAggregationExpression, IAggregationExpression + { + public AggregationExpression(IOperation expression, bool isGroupAggregation, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(isGroupAggregation, syntax, type, constantValue) + { + Expression = expression; + } + /// + /// Aggregation expression. + /// + public override IOperation Expression { get; } + } + + /// + /// Represents a group or function aggregation expression inside an Into clause of a Group By or Aggregate query clause in VB. + /// + internal sealed partial class LazyAggregationExpression : BaseAggregationExpression, IAggregationExpression + { + private readonly Lazy _lazyExression; + + public LazyAggregationExpression(Lazy expression, bool isGroupAggregation, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(isGroupAggregation, syntax, type, constantValue) + { + _lazyExression = expression ?? throw new System.ArgumentNullException(nameof(expression)); + } + /// + /// Aggregation expression. + /// + public override IOperation Expression => _lazyExression.Value; + } + + /// + /// Represents a query continuation in C#. + /// + internal abstract partial class BaseQueryContinuation : Operation, IQueryContinuation + { + protected BaseQueryContinuation(IRangeVariableSymbol declaredSymbol, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(OperationKind.QueryContinuation, syntax, type, constantValue) + { + DeclaredSymbol = declaredSymbol; + } + /// + /// Declared symbol. + /// + public IRangeVariableSymbol DeclaredSymbol { get; } + /// + /// Query body of the continuation. + /// + public abstract IOperation QueryBody { get; } + public override IEnumerable Children + { + get + { + yield return QueryBody; + } + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitQueryContinuation(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitQueryContinuation(this, argument); + } + } + + /// + /// Represents a query continuation in C#. + /// + internal sealed partial class QueryContinuation : BaseQueryContinuation, IQueryContinuation + { + public QueryContinuation(IOperation queryBody, IRangeVariableSymbol definedSymbol, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(definedSymbol, syntax, type, constantValue) + { + QueryBody = queryBody; + } + /// + /// Query body of the continuation. + /// + public override IOperation QueryBody { get; } + } + + /// + /// Represents a query continuation in C#. + /// + internal sealed partial class LazyQueryContinuation : BaseQueryContinuation, IQueryContinuation + { + private readonly Lazy _lazyQueryBody; + + public LazyQueryContinuation(Lazy queryBody, IRangeVariableSymbol definedSymbol, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(definedSymbol, syntax, type, constantValue) + { + _lazyQueryBody = queryBody ?? throw new System.ArgumentNullException(nameof(queryBody)); + } + /// + /// Query body of the continuation. + /// + public override IOperation QueryBody => _lazyQueryBody.Value; + } + + /// + /// Represents a query clause in C# or VB. + /// + internal abstract partial class BaseQueryClause : Operation, IQueryClause + { + protected BaseQueryClause(QueryClauseKind clauseKind, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(OperationKind.QueryClause, syntax, type, constantValue) + { + ClauseKind = clauseKind; + } + /// + /// of the clause. + /// + public QueryClauseKind ClauseKind { get; } + /// + /// Underlying reduced expression for the query clause. This is normally the invocation expression for the underlying linq call. + /// + public abstract IOperation ReducedExpression { get; } + public override IEnumerable Children + { + get + { + yield return ReducedExpression; + } + } + } + + /// + /// Represents a query clause in C# or VB. + /// + internal abstract partial class QueryClause : BaseQueryClause, IQueryClause + { + protected QueryClause(IOperation reducedExpression, QueryClauseKind clauseKind, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(clauseKind, syntax, type, constantValue) + { + ReducedExpression = reducedExpression; + } + /// + /// Underlying reduced expression for the query clause. This is normally the invocation expression for the underlying linq call. + /// + public override IOperation ReducedExpression { get; } + } + + /// + /// Represents a query clause in C# or VB. + /// + internal abstract partial class LazyQueryClause : BaseQueryClause, IQueryClause + { + private readonly Lazy _lazyReducedExpression; + + protected LazyQueryClause(Lazy reducedExpression, QueryClauseKind clauseKind, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(clauseKind, syntax, type, constantValue) + { + _lazyReducedExpression = reducedExpression ?? throw new System.ArgumentNullException(nameof(reducedExpression)); + } + /// + /// Underlying reduced expression for the query clause. This is normally the invocation expression for the underlying linq call. + /// + public override IOperation ReducedExpression => _lazyReducedExpression.Value; + } + + /// + /// Represents a from query clause in C# or VB. + /// + internal sealed partial class FromQueryClause : QueryClause, IFromQueryClause + { + public FromQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.FromClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitFromQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitFromQueryClause(this, argument); + } + } + + /// + /// Represents a from query clause in C# or VB. + /// + internal sealed partial class LazyFromQueryClause : LazyQueryClause, IFromQueryClause + { + public LazyFromQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.FromClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitFromQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitFromQueryClause(this, argument); + } + } + + /// + /// Represents a select query clause in C# or VB. + /// + internal sealed partial class SelectQueryClause : QueryClause, ISelectQueryClause + { + public SelectQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.SelectClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitSelectQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitSelectQueryClause(this, argument); + } + } + + /// + /// Represents a select query clause in C# or VB. + /// + internal sealed partial class LazySelectQueryClause : LazyQueryClause, ISelectQueryClause + { + public LazySelectQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.SelectClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitSelectQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitSelectQueryClause(this, argument); + } + } + + /// + /// Represents a where query clause in C# or VB. + /// + internal sealed partial class WhereQueryClause : QueryClause, IWhereQueryClause + { + public WhereQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.WhereClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitWhereQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitWhereQueryClause(this, argument); + } + } + + /// + /// Represents a where query clause in C# or VB. + /// + internal sealed partial class LazyWhereQueryClause : LazyQueryClause, IWhereQueryClause + { + public LazyWhereQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.WhereClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitWhereQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitWhereQueryClause(this, argument); + } + } + + /// + /// Represents a let query clause in C# or VB. + /// + internal sealed partial class LetQueryClause : QueryClause, ILetQueryClause + { + public LetQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.LetClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitLetQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitLetQueryClause(this, argument); + } + } + + /// + /// Represents a let query clause in C# or VB. + /// + internal sealed partial class LazyLetQueryClause : LazyQueryClause, ILetQueryClause + { + public LazyLetQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.LetClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitLetQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitLetQueryClause(this, argument); + } + } + + /// + /// Represents an order by query clause in C# or VB. + /// + internal sealed partial class OrderByQueryClause : QueryClause, IOrderByQueryClause + { + public OrderByQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.OrderByClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitOrderByQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitOrderByQueryClause(this, argument); + } + } + + /// + /// Represents an order by query clause in C# or VB. + /// + internal sealed partial class LazyOrderByQueryClause : LazyQueryClause, IOrderByQueryClause + { + public LazyOrderByQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.OrderByClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitOrderByQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitOrderByQueryClause(this, argument); + } + } + + /// + /// Represents a group by query clause in C# or VB. + /// + internal sealed partial class GroupByQueryClause : QueryClause, IGroupByQueryClause + { + public GroupByQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.GroupByClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitGroupByQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitGroupByQueryClause(this, argument); + } + } + + /// + /// Represents a group by query clause in C# or VB. + /// + internal sealed partial class LazyGroupByQueryClause : LazyQueryClause, IGroupByQueryClause + { + public LazyGroupByQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.GroupByClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitGroupByQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitGroupByQueryClause(this, argument); + } + } + + /// + /// Represents a group join query clause in VB. + /// + internal sealed partial class GroupJoinQueryClause : QueryClause, IGroupJoinQueryClause + { + public GroupJoinQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.GroupJoinClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitGroupJoinQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitGroupJoinQueryClause(this, argument); + } + } + + /// + /// Represents a group join query clause in VB. + /// + internal sealed partial class LazyGroupJoinQueryClause : LazyQueryClause, IGroupJoinQueryClause + { + public LazyGroupJoinQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.GroupJoinClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitGroupJoinQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitGroupJoinQueryClause(this, argument); + } + } + + /// + /// Represents a join query clause in C# or VB. + /// + internal sealed partial class JoinQueryClause : QueryClause, IJoinQueryClause + { + public JoinQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.JoinClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitJoinQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitJoinQueryClause(this, argument); + } + } + + /// + /// Represents a join query clause in C# or VB. + /// + internal sealed partial class LazyJoinQueryClause : LazyQueryClause, IJoinQueryClause + { + public LazyJoinQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.JoinClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitJoinQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitJoinQueryClause(this, argument); + } + } + + /// + /// Represents a join into query clause in C#. + /// + internal sealed partial class JoinIntoQueryClause : QueryClause, IJoinIntoQueryClause + { + public JoinIntoQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.JoinIntoClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitJoinIntoQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitJoinIntoQueryClause(this, argument); + } + } + + /// + /// Represents a join into query clause in C#. + /// + internal sealed partial class LazyJoinIntoQueryClause : LazyQueryClause, IJoinIntoQueryClause + { + public LazyJoinIntoQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.JoinIntoClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitJoinIntoQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitJoinIntoQueryClause(this, argument); + } + } + + /// + /// Represents a distinct query clause in VB. + /// + internal sealed partial class DistinctQueryClause : QueryClause, IDistinctQueryClause + { + public DistinctQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.DistinctClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitDistinctQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitDistinctQueryClause(this, argument); + } + } + + /// + /// Represents a distinct query clause in VB. + /// + internal sealed partial class LazyDistinctQueryClause : LazyQueryClause, IDistinctQueryClause + { + public LazyDistinctQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.DistinctClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitDistinctQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitDistinctQueryClause(this, argument); + } + } + + /// + /// Represents an aggregate query clause in VB. + /// + internal sealed partial class AggregateQueryClause : QueryClause, IAggregateQueryClause + { + public AggregateQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.AggregateClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitAggregateQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitAggregateQueryClause(this, argument); + } + } + + /// + /// Represents an aggregate query clause in VB. + /// + internal sealed partial class LazyAggregateQueryClause : LazyQueryClause, IAggregateQueryClause + { + public LazyAggregateQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.AggregateClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitAggregateQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitAggregateQueryClause(this, argument); + } + } + + /// + /// Represents a skip query clause in VB. + /// + internal sealed partial class SkipQueryClause : QueryClause, ISkipQueryClause + { + public SkipQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.SkipClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitSkipQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitSkipQueryClause(this, argument); + } + } + + /// + /// Represents a skip query clause in VB. + /// + internal sealed partial class LazySkipQueryClause : LazyQueryClause, ISkipQueryClause + { + public LazySkipQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.SkipClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitSkipQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitSkipQueryClause(this, argument); + } + } + + /// + /// Represents a skip while query clause in VB. + /// + internal sealed partial class SkipWhileQueryClause : QueryClause, ISkipWhileQueryClause + { + public SkipWhileQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.SkipWhileClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitSkipWhileQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitSkipWhileQueryClause(this, argument); + } + } + + /// + /// Represents a skip while query clause in VB. + /// + internal sealed partial class LazySkipWhileQueryClause : LazyQueryClause, ISkipWhileQueryClause + { + public LazySkipWhileQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.SkipWhileClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitSkipWhileQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitSkipWhileQueryClause(this, argument); + } + } + + /// + /// Represents a take query clause in VB. + /// + internal sealed partial class TakeQueryClause : QueryClause, ITakeQueryClause + { + public TakeQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.TakeClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitTakeQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitTakeQueryClause(this, argument); + } + } + + /// + /// Represents a take query clause in VB. + /// + internal sealed partial class LazyTakeQueryClause : LazyQueryClause, ITakeQueryClause + { + public LazyTakeQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.TakeClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitTakeQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitTakeQueryClause(this, argument); + } + } + + /// + /// Represents a take while query clause in VB. + /// + internal sealed partial class TakeWhileQueryClause : QueryClause, ITakeWhileQueryClause + { + public TakeWhileQueryClause(IOperation reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.TakeWhileClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitTakeWhileQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitTakeWhileQueryClause(this, argument); + } + } + + /// + /// Represents a take while query clause in VB. + /// + internal sealed partial class LazyTakeWhileQueryClause : LazyQueryClause, ITakeWhileQueryClause + { + public LazyTakeWhileQueryClause(Lazy reducedExpression, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(reducedExpression, QueryClauseKind.TakeWhileClause, syntax, type, constantValue) + { + } + public override void Accept(OperationVisitor visitor) + { + visitor.VisitTakeWhileQueryClause(this); + } + public override TResult Accept(OperationVisitor visitor, TArgument argument) + { + return visitor.VisitTakeWhileQueryClause(this, argument); + } + } } diff --git a/src/Compilers/Core/Portable/Operations/OperationKind.cs b/src/Compilers/Core/Portable/Operations/OperationKind.cs index f0a17227330cd..fe5268eb62fb3 100644 --- a/src/Compilers/Core/Portable/Operations/OperationKind.cs +++ b/src/Compilers/Core/Portable/Operations/OperationKind.cs @@ -142,6 +142,10 @@ public enum OperationKind DynamicObjectCreationExpression = 0x125, /// Indicates an . DynamicMemberReferenceExpression = 0x126, + /// Indicates an . + QueryExpression = 0x127, + /// Indicates an in an . + OrderingExpression = 0x128, // Expressions that occur only in C#. @@ -166,7 +170,8 @@ public enum OperationKind /// Indicates an . OmittedArgumentExpression = 0x300, - // 0x301 was removed, and is available for use. + /// Indicates an . + AggregationExpression = 0x301, /// Indicates an . PlaceholderExpression = 0x302, @@ -216,5 +221,10 @@ public enum OperationKind /// Indicates an . DefaultCaseClause = 0x412, + + /// Indicates an . + QueryClause = 0x413, + /// Indicates an . + QueryContinuation = 0x414, } } diff --git a/src/Compilers/Core/Portable/Operations/OperationVisitor.cs b/src/Compilers/Core/Portable/Operations/OperationVisitor.cs index 56c1f3b4db093..8fdd04e10416a 100644 --- a/src/Compilers/Core/Portable/Operations/OperationVisitor.cs +++ b/src/Compilers/Core/Portable/Operations/OperationVisitor.cs @@ -464,6 +464,101 @@ public virtual void VisitTupleExpression(ITupleExpression operation) { DefaultVisit(operation); } + + public virtual void VisitQueryExpression(IQueryExpression operation) + { + DefaultVisit(operation); + } + + public virtual void VisitOrderingExpression(IOrderingExpression operation) + { + DefaultVisit(operation); + } + + public virtual void VisitAggregationExpression(IAggregationExpression operation) + { + DefaultVisit(operation); + } + + public virtual void VisitQueryContinuation(IQueryContinuation operation) + { + DefaultVisit(operation); + } + + public virtual void VisitFromQueryClause(IFromQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitSelectQueryClause(ISelectQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitWhereQueryClause(IWhereQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitLetQueryClause(ILetQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitOrderByQueryClause(IOrderByQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitGroupByQueryClause(IGroupByQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitGroupJoinQueryClause(IGroupJoinQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitJoinQueryClause(IJoinQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitJoinIntoQueryClause(IJoinIntoQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitDistinctQueryClause(IDistinctQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitAggregateQueryClause(IAggregateQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitSkipQueryClause(ISkipQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitSkipWhileQueryClause(ISkipWhileQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitTakeQueryClause(ITakeQueryClause operation) + { + DefaultVisit(operation); + } + + public virtual void VisitTakeWhileQueryClause(ITakeWhileQueryClause operation) + { + DefaultVisit(operation); + } } /// @@ -934,5 +1029,100 @@ public virtual TResult VisitTupleExpression(ITupleExpression operation, TArgumen { return DefaultVisit(operation, argument); } + + public virtual TResult VisitQueryExpression(IQueryExpression operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitOrderingExpression(IOrderingExpression operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitAggregationExpression(IAggregationExpression operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitQueryContinuation(IQueryContinuation operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitFromQueryClause(IFromQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitSelectQueryClause(ISelectQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitWhereQueryClause(IWhereQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitLetQueryClause(ILetQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitOrderByQueryClause(IOrderByQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitGroupByQueryClause(IGroupByQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitGroupJoinQueryClause(IGroupJoinQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitJoinQueryClause(IJoinQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitJoinIntoQueryClause(IJoinIntoQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitDistinctQueryClause(IDistinctQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitAggregateQueryClause(IAggregateQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitSkipQueryClause(ISkipQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitSkipWhileQueryClause(ISkipWhileQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitTakeQueryClause(ITakeQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } + + public virtual TResult VisitTakeWhileQueryClause(ITakeWhileQueryClause operation, TArgument argument) + { + return DefaultVisit(operation, argument); + } } } diff --git a/src/Compilers/Core/Portable/Operations/Queries/IAggregateQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IAggregateQueryClause.cs new file mode 100644 index 0000000000000..9d4ad2aec2067 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IAggregateQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents an aggregate query clause in VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IAggregateQueryClause : IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IAggregationExpression.cs b/src/Compilers/Core/Portable/Operations/Queries/IAggregationExpression.cs new file mode 100644 index 0000000000000..df85928d531b9 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IAggregationExpression.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a group or function aggregation expression inside an Into clause of a Group By or Aggregate query clause in VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IAggregationExpression : IOperation + { + /// + /// Flag indicating if this is a group aggregation clause. + /// + bool IsGroupAggregation { get; } + + /// + /// Aggregation expression. + /// + IOperation Expression { get; } + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IDistinctQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IDistinctQueryClause.cs new file mode 100644 index 0000000000000..b8ec55b4652d3 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IDistinctQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a distinct query clause in VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IDistinctQueryClause : IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IFromQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IFromQueryClause.cs new file mode 100644 index 0000000000000..33a0bee240635 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IFromQueryClause.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections.Immutable; + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a from query clause in C# or VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IFromQueryClause: IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IGroupByQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IGroupByQueryClause.cs new file mode 100644 index 0000000000000..3650dab94179a --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IGroupByQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a group by query clause in C# or VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IGroupByQueryClause: IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IGroupJoinQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IGroupJoinQueryClause.cs new file mode 100644 index 0000000000000..9d847b62069e9 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IGroupJoinQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a group join query clause in VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IGroupJoinQueryClause : IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IJoinIntoQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IJoinIntoQueryClause.cs new file mode 100644 index 0000000000000..d3d5f749e8410 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IJoinIntoQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a join into query clause in C#. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IJoinIntoQueryClause : IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IJoinQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IJoinQueryClause.cs new file mode 100644 index 0000000000000..1fb08e899da46 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IJoinQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a join query clause in C# or VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IJoinQueryClause : IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/ILetQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/ILetQueryClause.cs new file mode 100644 index 0000000000000..8647b77ee4ba0 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/ILetQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a let query clause in C# or VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface ILetQueryClause : IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IOrderByQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IOrderByQueryClause.cs new file mode 100644 index 0000000000000..7e9f2fa48df33 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IOrderByQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents an order by query clause in C# or VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IOrderByQueryClause: IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IOrderExpression.cs b/src/Compilers/Core/Portable/Operations/Queries/IOrderExpression.cs new file mode 100644 index 0000000000000..df9fa784418e2 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IOrderExpression.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents an ordering expression within an in C# or VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IOrderingExpression : IOperation + { + /// + /// for the ordering expression. + /// + OrderKind OrderKind { get; } + /// + /// Underlying ordering expression for the order by query clause. + /// + IOperation Expression { get; } + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IQueryClause.cs new file mode 100644 index 0000000000000..e5ef6c23644a0 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IQueryClause.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a query clause in C# or VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IQueryClause : IOperation + { + /// + /// of the clause. + /// + QueryClauseKind ClauseKind { get; } + + /// + /// Underlying reduced expression for the query clause. This is normally the invocation expression for the underlying linq call. + /// + IOperation ReducedExpression { get; } + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IQueryContinuation.cs b/src/Compilers/Core/Portable/Operations/Queries/IQueryContinuation.cs new file mode 100644 index 0000000000000..d2f8da311bf52 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IQueryContinuation.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a query continuation in C#. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IQueryContinuation : IOperation + { + /// + /// Declared symbol. + /// + IRangeVariableSymbol DeclaredSymbol { get; } + + /// + /// Query body of the continuation. + /// + IOperation QueryBody { get; } + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IQueryExpression.cs b/src/Compilers/Core/Portable/Operations/Queries/IQueryExpression.cs new file mode 100644 index 0000000000000..630afb0288425 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IQueryExpression.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a query expression in C# or VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IQueryExpression : IOperation + { + /// + /// Last or in the unrolled query expression. + /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, + /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. + /// + IOperation LastClauseOrContinuation { get; } + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/ISelectQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/ISelectQueryClause.cs new file mode 100644 index 0000000000000..65187b4e4911d --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/ISelectQueryClause.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections.Immutable; + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a select query clause in C# or VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface ISelectQueryClause: IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/ISkipQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/ISkipQueryClause.cs new file mode 100644 index 0000000000000..4a4c49b9f3603 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/ISkipQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a skip query clause in VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface ISkipQueryClause : IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/ISkipWhileQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/ISkipWhileQueryClause.cs new file mode 100644 index 0000000000000..3e414094122e7 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/ISkipWhileQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a skip while query clause in VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface ISkipWhileQueryClause : IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/ITakeQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/ITakeQueryClause.cs new file mode 100644 index 0000000000000..2aafb7745167e --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/ITakeQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a take query clause in VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface ITakeQueryClause : IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/ITakeWhileQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/ITakeWhileQueryClause.cs new file mode 100644 index 0000000000000..8291c56628b3e --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/ITakeWhileQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a take while query clause in VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface ITakeWhileQueryClause : IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IWhereQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IWhereQueryClause.cs new file mode 100644 index 0000000000000..0d9053ac002a0 --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/IWhereQueryClause.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Represents a where query clause in C# or VB. + /// + /// + /// This interface is reserved for implementation by its associated APIs. We reserve the right to + /// change it in the future. + /// + public interface IWhereQueryClause: IQueryClause + { + } +} diff --git a/src/Compilers/Core/Portable/Operations/Queries/OrderKind.cs b/src/Compilers/Core/Portable/Operations/Queries/OrderKind.cs new file mode 100644 index 0000000000000..743a3966dbced --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/OrderKind.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Kind of ordering for an + /// + public enum OrderKind + { + /// + /// Represents no ordering for an . + /// + None = 0x0, + + /// + /// Represents an ascending ordering for an . + /// + Ascending = 0x1, + + /// + /// Represents an ascending ordering for an . + /// + Descending = 0x2, + } +} + diff --git a/src/Compilers/Core/Portable/Operations/Queries/QueryClauseKind.cs b/src/Compilers/Core/Portable/Operations/Queries/QueryClauseKind.cs new file mode 100644 index 0000000000000..1b9f7b2d342ee --- /dev/null +++ b/src/Compilers/Core/Portable/Operations/Queries/QueryClauseKind.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Semantics +{ + /// + /// Kind of within an . + /// + public enum QueryClauseKind + { + /// Indicates an invalid clause kind. + None = 0x00, + /// Indicates an in C# and VB. + FromClause = 0x01, + /// Indicates an in C# and VB. + SelectClause = 0x02, + /// Indicates an in C# and VB. + WhereClause = 0x03, + /// Indicates an in C# and VB. + LetClause = 0x04, + /// Indicates an in C# and VB. + OrderByClause = 0x05, + /// Indicates an in C# and VB. + GroupByClause = 0x06, + /// Indicates an in VB. + GroupJoinClause = 0x07, + /// Indicates an in C# and VB. + JoinClause = 0x08, + /// Indicates an in C#. + JoinIntoClause = 0x09, + /// Indicates an in VB. + DistinctClause = 0x0a, + /// Indicates an in VB. + AggregateClause = 0x0b, + /// Indicates an in VB. + SkipClause = 0x0c, + /// Indicates an in VB. + SkipWhileClause = 0x0d, + /// Indicates an in VB. + TakeClause = 0x0e, + /// Indicates an in VB. + TakeWhileClause = 0x0f, + } +} + diff --git a/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt b/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt index 10a1fd6177789..e94a3079639a0 100644 --- a/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt +++ b/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt @@ -46,6 +46,7 @@ Microsoft.CodeAnalysis.IOperation.Syntax.get -> Microsoft.CodeAnalysis.SyntaxNod Microsoft.CodeAnalysis.IOperation.Type.get -> Microsoft.CodeAnalysis.ITypeSymbol Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.AddressOfExpression = 515 -> Microsoft.CodeAnalysis.OperationKind +Microsoft.CodeAnalysis.OperationKind.AggregationExpression = 769 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.AnonymousObjectCreationExpression = 287 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.Argument = 1031 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ArrayCreationExpression = 276 -> Microsoft.CodeAnalysis.OperationKind @@ -66,8 +67,8 @@ Microsoft.CodeAnalysis.OperationKind.ConversionExpression = 258 -> Microsoft.Cod Microsoft.CodeAnalysis.OperationKind.DeclarationPattern = 1040 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.DefaultCaseClause = 1042 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.DefaultValueExpression = 512 -> Microsoft.CodeAnalysis.OperationKind -Microsoft.CodeAnalysis.OperationKind.DynamicObjectCreationExpression = 293 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.DynamicMemberReferenceExpression = 294 -> Microsoft.CodeAnalysis.OperationKind +Microsoft.CodeAnalysis.OperationKind.DynamicObjectCreationExpression = 293 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.EmptyStatement = 9 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.EndStatement = 81 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.EventAssignmentExpression = 283 -> Microsoft.CodeAnalysis.OperationKind @@ -102,6 +103,7 @@ Microsoft.CodeAnalysis.OperationKind.NullCoalescingExpression = 272 -> Microsoft Microsoft.CodeAnalysis.OperationKind.ObjectCreationExpression = 274 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ObjectOrCollectionInitializerExpression = 288 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.OmittedArgumentExpression = 768 -> Microsoft.CodeAnalysis.OperationKind +Microsoft.CodeAnalysis.OperationKind.OrderingExpression = 296 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ParameterInitializer = 1028 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ParameterReferenceExpression = 262 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ParenthesizedExpression = 282 -> Microsoft.CodeAnalysis.OperationKind @@ -110,6 +112,9 @@ Microsoft.CodeAnalysis.OperationKind.PlaceholderExpression = 770 -> Microsoft.Co Microsoft.CodeAnalysis.OperationKind.PointerIndirectionReferenceExpression = 516 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.PropertyInitializer = 1027 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.PropertyReferenceExpression = 266 -> Microsoft.CodeAnalysis.OperationKind +Microsoft.CodeAnalysis.OperationKind.QueryClause = 1043 -> Microsoft.CodeAnalysis.OperationKind +Microsoft.CodeAnalysis.OperationKind.QueryContinuation = 1044 -> Microsoft.CodeAnalysis.OperationKind +Microsoft.CodeAnalysis.OperationKind.QueryExpression = 295 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.RangeCaseClause = 1036 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.RelationalCaseClause = 1035 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ReturnStatement = 11 -> Microsoft.CodeAnalysis.OperationKind @@ -331,6 +336,10 @@ Microsoft.CodeAnalysis.Semantics.ConversionKind.OperatorMethod = 5 -> Microsoft. Microsoft.CodeAnalysis.Semantics.ConversionKind.TryCast = 2 -> Microsoft.CodeAnalysis.Semantics.ConversionKind Microsoft.CodeAnalysis.Semantics.IAddressOfExpression Microsoft.CodeAnalysis.Semantics.IAddressOfExpression.Reference.get -> Microsoft.CodeAnalysis.IOperation +Microsoft.CodeAnalysis.Semantics.IAggregateQueryClause +Microsoft.CodeAnalysis.Semantics.IAggregationExpression +Microsoft.CodeAnalysis.Semantics.IAggregationExpression.Expression.get -> Microsoft.CodeAnalysis.IOperation +Microsoft.CodeAnalysis.Semantics.IAggregationExpression.IsGroupAggregation.get -> bool Microsoft.CodeAnalysis.Semantics.IAnonymousObjectCreationExpression Microsoft.CodeAnalysis.Semantics.IAnonymousObjectCreationExpression.Initializers.get -> System.Collections.Immutable.ImmutableArray Microsoft.CodeAnalysis.Semantics.IArgument @@ -394,6 +403,7 @@ Microsoft.CodeAnalysis.Semantics.IDeclarationPattern Microsoft.CodeAnalysis.Semantics.IDeclarationPattern.DeclaredSymbol.get -> Microsoft.CodeAnalysis.ISymbol Microsoft.CodeAnalysis.Semantics.IDefaultCaseClause Microsoft.CodeAnalysis.Semantics.IDefaultValueExpression +Microsoft.CodeAnalysis.Semantics.IDistinctQueryClause Microsoft.CodeAnalysis.Semantics.IDynamicMemberReferenceExpression Microsoft.CodeAnalysis.Semantics.IDynamicMemberReferenceExpression.ContainingType.get -> Microsoft.CodeAnalysis.ITypeSymbol Microsoft.CodeAnalysis.Semantics.IDynamicMemberReferenceExpression.Instance.get -> Microsoft.CodeAnalysis.IOperation @@ -428,6 +438,9 @@ Microsoft.CodeAnalysis.Semantics.IForLoopStatement.Before.get -> System.Collecti Microsoft.CodeAnalysis.Semantics.IForLoopStatement.Locals.get -> System.Collections.Immutable.ImmutableArray Microsoft.CodeAnalysis.Semantics.IForWhileUntilLoopStatement Microsoft.CodeAnalysis.Semantics.IForWhileUntilLoopStatement.Condition.get -> Microsoft.CodeAnalysis.IOperation +Microsoft.CodeAnalysis.Semantics.IFromQueryClause +Microsoft.CodeAnalysis.Semantics.IGroupByQueryClause +Microsoft.CodeAnalysis.Semantics.IGroupJoinQueryClause Microsoft.CodeAnalysis.Semantics.IHasArgumentsExpression Microsoft.CodeAnalysis.Semantics.IHasArgumentsExpression.ArgumentsInEvaluationOrder.get -> System.Collections.Immutable.ImmutableArray Microsoft.CodeAnalysis.Semantics.IHasDynamicArgumentsExpression @@ -469,12 +482,15 @@ Microsoft.CodeAnalysis.Semantics.IIsPatternExpression.Pattern.get -> Microsoft.C Microsoft.CodeAnalysis.Semantics.IIsTypeExpression Microsoft.CodeAnalysis.Semantics.IIsTypeExpression.IsType.get -> Microsoft.CodeAnalysis.ITypeSymbol Microsoft.CodeAnalysis.Semantics.IIsTypeExpression.Operand.get -> Microsoft.CodeAnalysis.IOperation +Microsoft.CodeAnalysis.Semantics.IJoinIntoQueryClause +Microsoft.CodeAnalysis.Semantics.IJoinQueryClause Microsoft.CodeAnalysis.Semantics.ILabelStatement Microsoft.CodeAnalysis.Semantics.ILabelStatement.Label.get -> Microsoft.CodeAnalysis.ILabelSymbol Microsoft.CodeAnalysis.Semantics.ILabelStatement.LabeledStatement.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.ILambdaExpression Microsoft.CodeAnalysis.Semantics.ILambdaExpression.Body.get -> Microsoft.CodeAnalysis.Semantics.IBlockStatement Microsoft.CodeAnalysis.Semantics.ILambdaExpression.Signature.get -> Microsoft.CodeAnalysis.IMethodSymbol +Microsoft.CodeAnalysis.Semantics.ILetQueryClause Microsoft.CodeAnalysis.Semantics.ILiteralExpression Microsoft.CodeAnalysis.Semantics.ILiteralExpression.Text.get -> string Microsoft.CodeAnalysis.Semantics.ILocalFunctionStatement @@ -508,6 +524,10 @@ Microsoft.CodeAnalysis.Semantics.IObjectCreationExpression.Initializer.get -> Mi Microsoft.CodeAnalysis.Semantics.IObjectOrCollectionInitializerExpression Microsoft.CodeAnalysis.Semantics.IObjectOrCollectionInitializerExpression.Initializers.get -> System.Collections.Immutable.ImmutableArray Microsoft.CodeAnalysis.Semantics.IOmittedArgumentExpression +Microsoft.CodeAnalysis.Semantics.IOrderByQueryClause +Microsoft.CodeAnalysis.Semantics.IOrderingExpression +Microsoft.CodeAnalysis.Semantics.IOrderingExpression.Expression.get -> Microsoft.CodeAnalysis.IOperation +Microsoft.CodeAnalysis.Semantics.IOrderingExpression.OrderKind.get -> Microsoft.CodeAnalysis.Semantics.OrderKind Microsoft.CodeAnalysis.Semantics.IParameterInitializer Microsoft.CodeAnalysis.Semantics.IParameterInitializer.Parameter.get -> Microsoft.CodeAnalysis.IParameterSymbol Microsoft.CodeAnalysis.Semantics.IParameterReferenceExpression @@ -526,6 +546,14 @@ Microsoft.CodeAnalysis.Semantics.IPropertyInitializer Microsoft.CodeAnalysis.Semantics.IPropertyInitializer.InitializedProperty.get -> Microsoft.CodeAnalysis.IPropertySymbol Microsoft.CodeAnalysis.Semantics.IPropertyReferenceExpression Microsoft.CodeAnalysis.Semantics.IPropertyReferenceExpression.Property.get -> Microsoft.CodeAnalysis.IPropertySymbol +Microsoft.CodeAnalysis.Semantics.IQueryClause +Microsoft.CodeAnalysis.Semantics.IQueryClause.ClauseKind.get -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.IQueryClause.ReducedExpression.get -> Microsoft.CodeAnalysis.IOperation +Microsoft.CodeAnalysis.Semantics.IQueryContinuation +Microsoft.CodeAnalysis.Semantics.IQueryContinuation.DeclaredSymbol.get -> Microsoft.CodeAnalysis.IRangeVariableSymbol +Microsoft.CodeAnalysis.Semantics.IQueryContinuation.QueryBody.get -> Microsoft.CodeAnalysis.IOperation +Microsoft.CodeAnalysis.Semantics.IQueryExpression +Microsoft.CodeAnalysis.Semantics.IQueryExpression.LastClauseOrContinuation.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IRangeCaseClause Microsoft.CodeAnalysis.Semantics.IRangeCaseClause.MaximumValue.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IRangeCaseClause.MinimumValue.get -> Microsoft.CodeAnalysis.IOperation @@ -534,11 +562,14 @@ Microsoft.CodeAnalysis.Semantics.IRelationalCaseClause.Relation.get -> Microsoft Microsoft.CodeAnalysis.Semantics.IRelationalCaseClause.Value.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IReturnStatement Microsoft.CodeAnalysis.Semantics.IReturnStatement.ReturnedValue.get -> Microsoft.CodeAnalysis.IOperation +Microsoft.CodeAnalysis.Semantics.ISelectQueryClause Microsoft.CodeAnalysis.Semantics.ISimpleAssignmentExpression Microsoft.CodeAnalysis.Semantics.ISingleValueCaseClause Microsoft.CodeAnalysis.Semantics.ISingleValueCaseClause.Equality.get -> Microsoft.CodeAnalysis.Semantics.BinaryOperationKind Microsoft.CodeAnalysis.Semantics.ISingleValueCaseClause.Value.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.ISizeOfExpression +Microsoft.CodeAnalysis.Semantics.ISkipQueryClause +Microsoft.CodeAnalysis.Semantics.ISkipWhileQueryClause Microsoft.CodeAnalysis.Semantics.IStopStatement Microsoft.CodeAnalysis.Semantics.ISwitchCase Microsoft.CodeAnalysis.Semantics.ISwitchCase.Body.get -> System.Collections.Immutable.ImmutableArray @@ -551,6 +582,8 @@ Microsoft.CodeAnalysis.Semantics.ISymbolInitializer.Value.get -> Microsoft.CodeA Microsoft.CodeAnalysis.Semantics.ISyntheticLocalReferenceExpression Microsoft.CodeAnalysis.Semantics.ISyntheticLocalReferenceExpression.ContainingStatement.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.ISyntheticLocalReferenceExpression.SyntheticLocalKind.get -> Microsoft.CodeAnalysis.Semantics.SyntheticLocalKind +Microsoft.CodeAnalysis.Semantics.ITakeQueryClause +Microsoft.CodeAnalysis.Semantics.ITakeWhileQueryClause Microsoft.CodeAnalysis.Semantics.IThrowExpression Microsoft.CodeAnalysis.Semantics.IThrowExpression.Expression.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IThrowStatement @@ -578,6 +611,7 @@ Microsoft.CodeAnalysis.Semantics.IVariableDeclaration.Initializer.get -> Microso Microsoft.CodeAnalysis.Semantics.IVariableDeclaration.Variables.get -> System.Collections.Immutable.ImmutableArray Microsoft.CodeAnalysis.Semantics.IVariableDeclarationStatement Microsoft.CodeAnalysis.Semantics.IVariableDeclarationStatement.Declarations.get -> System.Collections.Immutable.ImmutableArray +Microsoft.CodeAnalysis.Semantics.IWhereQueryClause Microsoft.CodeAnalysis.Semantics.IWhileUntilLoopStatement Microsoft.CodeAnalysis.Semantics.IWhileUntilLoopStatement.IsTopTest.get -> bool Microsoft.CodeAnalysis.Semantics.IWhileUntilLoopStatement.IsWhile.get -> bool @@ -602,6 +636,27 @@ Microsoft.CodeAnalysis.Semantics.OperationVisitor Microsoft.CodeAnalysis.Semantics.OperationVisitor.OperationVisitor() -> void Microsoft.CodeAnalysis.Semantics.OperationWalker Microsoft.CodeAnalysis.Semantics.OperationWalker.OperationWalker() -> void +Microsoft.CodeAnalysis.Semantics.OrderKind +Microsoft.CodeAnalysis.Semantics.OrderKind.Ascending = 1 -> Microsoft.CodeAnalysis.Semantics.OrderKind +Microsoft.CodeAnalysis.Semantics.OrderKind.Descending = 2 -> Microsoft.CodeAnalysis.Semantics.OrderKind +Microsoft.CodeAnalysis.Semantics.OrderKind.None = 0 -> Microsoft.CodeAnalysis.Semantics.OrderKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.AggregateClause = 11 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.DistinctClause = 10 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.FromClause = 1 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.GroupByClause = 6 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.GroupJoinClause = 7 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.JoinClause = 8 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.JoinIntoClause = 9 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.LetClause = 4 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.None = 0 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.OrderByClause = 5 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.SelectClause = 2 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.SkipClause = 12 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.SkipWhileClause = 13 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.TakeClause = 14 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.TakeWhileClause = 15 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind +Microsoft.CodeAnalysis.Semantics.QueryClauseKind.WhereClause = 3 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind Microsoft.CodeAnalysis.Semantics.SimpleBinaryOperationKind Microsoft.CodeAnalysis.Semantics.SimpleBinaryOperationKind.Add = 1 -> Microsoft.CodeAnalysis.Semantics.SimpleBinaryOperationKind Microsoft.CodeAnalysis.Semantics.SimpleBinaryOperationKind.And = 10 -> Microsoft.CodeAnalysis.Semantics.SimpleBinaryOperationKind @@ -762,6 +817,8 @@ virtual Microsoft.CodeAnalysis.Diagnostics.CompilationStartAnalysisContext.Regis virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.DefaultVisit(Microsoft.CodeAnalysis.IOperation operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Visit(Microsoft.CodeAnalysis.IOperation operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAddressOfExpression(Microsoft.CodeAnalysis.Semantics.IAddressOfExpression operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAggregateQueryClause(Microsoft.CodeAnalysis.Semantics.IAggregateQueryClause operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAggregationExpression(Microsoft.CodeAnalysis.Semantics.IAggregationExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAnonymousObjectCreationExpression(Microsoft.CodeAnalysis.Semantics.IAnonymousObjectCreationExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitArgument(Microsoft.CodeAnalysis.Semantics.IArgument operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitArrayCreationExpression(Microsoft.CodeAnalysis.Semantics.IArrayCreationExpression operation) -> void @@ -782,6 +839,7 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitConversionExpress virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDeclarationPattern(Microsoft.CodeAnalysis.Semantics.IDeclarationPattern operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDefaultCaseClause(Microsoft.CodeAnalysis.Semantics.IDefaultCaseClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDefaultValueExpression(Microsoft.CodeAnalysis.Semantics.IDefaultValueExpression operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDistinctQueryClause(Microsoft.CodeAnalysis.Semantics.IDistinctQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDynamicMemberReferenceExpression(Microsoft.CodeAnalysis.Semantics.IDynamicMemberReferenceExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDynamicObjectCreationExpression(Microsoft.CodeAnalysis.Semantics.IDynamicObjectCreationExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitEmptyStatement(Microsoft.CodeAnalysis.Semantics.IEmptyStatement operation) -> void @@ -794,6 +852,9 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitFieldReferenceExp virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitFixedStatement(Microsoft.CodeAnalysis.Semantics.IFixedStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitForEachLoopStatement(Microsoft.CodeAnalysis.Semantics.IForEachLoopStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitForLoopStatement(Microsoft.CodeAnalysis.Semantics.IForLoopStatement operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitFromQueryClause(Microsoft.CodeAnalysis.Semantics.IFromQueryClause operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitGroupByQueryClause(Microsoft.CodeAnalysis.Semantics.IGroupByQueryClause operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitGroupJoinQueryClause(Microsoft.CodeAnalysis.Semantics.IGroupJoinQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIfStatement(Microsoft.CodeAnalysis.Semantics.IIfStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIncrementExpression(Microsoft.CodeAnalysis.Semantics.IIncrementExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitInstanceReferenceExpression(Microsoft.CodeAnalysis.Semantics.IInstanceReferenceExpression operation) -> void @@ -805,8 +866,11 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitInvalidStatement( virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitInvocationExpression(Microsoft.CodeAnalysis.Semantics.IInvocationExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIsPatternExpression(Microsoft.CodeAnalysis.Semantics.IIsPatternExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIsTypeExpression(Microsoft.CodeAnalysis.Semantics.IIsTypeExpression operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitJoinIntoQueryClause(Microsoft.CodeAnalysis.Semantics.IJoinIntoQueryClause operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitJoinQueryClause(Microsoft.CodeAnalysis.Semantics.IJoinQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLabelStatement(Microsoft.CodeAnalysis.Semantics.ILabelStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLambdaExpression(Microsoft.CodeAnalysis.Semantics.ILambdaExpression operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLetQueryClause(Microsoft.CodeAnalysis.Semantics.ILetQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLiteralExpression(Microsoft.CodeAnalysis.Semantics.ILiteralExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLocalFunctionStatement(Microsoft.CodeAnalysis.Semantics.ILocalFunctionStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLocalReferenceExpression(Microsoft.CodeAnalysis.Semantics.ILocalReferenceExpression operation) -> void @@ -818,6 +882,8 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitNullCoalescingExp virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitObjectCreationExpression(Microsoft.CodeAnalysis.Semantics.IObjectCreationExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitObjectOrCollectionInitializerExpression(Microsoft.CodeAnalysis.Semantics.IObjectOrCollectionInitializerExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitOmittedArgumentExpression(Microsoft.CodeAnalysis.Semantics.IOmittedArgumentExpression operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitOrderByQueryClause(Microsoft.CodeAnalysis.Semantics.IOrderByQueryClause operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitOrderingExpression(Microsoft.CodeAnalysis.Semantics.IOrderingExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitParameterInitializer(Microsoft.CodeAnalysis.Semantics.IParameterInitializer operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitParameterReferenceExpression(Microsoft.CodeAnalysis.Semantics.IParameterReferenceExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitParenthesizedExpression(Microsoft.CodeAnalysis.Semantics.IParenthesizedExpression operation) -> void @@ -826,16 +892,23 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPlaceholderExpres virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPointerIndirectionReferenceExpression(Microsoft.CodeAnalysis.Semantics.IPointerIndirectionReferenceExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPropertyInitializer(Microsoft.CodeAnalysis.Semantics.IPropertyInitializer operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPropertyReferenceExpression(Microsoft.CodeAnalysis.Semantics.IPropertyReferenceExpression operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitQueryContinuation(Microsoft.CodeAnalysis.Semantics.IQueryContinuation operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitQueryExpression(Microsoft.CodeAnalysis.Semantics.IQueryExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitRangeCaseClause(Microsoft.CodeAnalysis.Semantics.IRangeCaseClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitRelationalCaseClause(Microsoft.CodeAnalysis.Semantics.IRelationalCaseClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitReturnStatement(Microsoft.CodeAnalysis.Semantics.IReturnStatement operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSelectQueryClause(Microsoft.CodeAnalysis.Semantics.ISelectQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSimpleAssignmentExpression(Microsoft.CodeAnalysis.Semantics.ISimpleAssignmentExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSingleValueCaseClause(Microsoft.CodeAnalysis.Semantics.ISingleValueCaseClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSizeOfExpression(Microsoft.CodeAnalysis.Semantics.ISizeOfExpression operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSkipQueryClause(Microsoft.CodeAnalysis.Semantics.ISkipQueryClause operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSkipWhileQueryClause(Microsoft.CodeAnalysis.Semantics.ISkipWhileQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitStopStatement(Microsoft.CodeAnalysis.Semantics.IStopStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSwitchCase(Microsoft.CodeAnalysis.Semantics.ISwitchCase operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSwitchStatement(Microsoft.CodeAnalysis.Semantics.ISwitchStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSyntheticLocalReferenceExpression(Microsoft.CodeAnalysis.Semantics.ISyntheticLocalReferenceExpression operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTakeQueryClause(Microsoft.CodeAnalysis.Semantics.ITakeQueryClause operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTakeWhileQueryClause(Microsoft.CodeAnalysis.Semantics.ITakeWhileQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitThrowExpression(Microsoft.CodeAnalysis.Semantics.IThrowExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitThrowStatement(Microsoft.CodeAnalysis.Semantics.IThrowStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTryStatement(Microsoft.CodeAnalysis.Semantics.ITryStatement operation) -> void @@ -846,12 +919,15 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitUnaryOperatorExpr virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitUsingStatement(Microsoft.CodeAnalysis.Semantics.IUsingStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitVariableDeclaration(Microsoft.CodeAnalysis.Semantics.IVariableDeclaration operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitVariableDeclarationStatement(Microsoft.CodeAnalysis.Semantics.IVariableDeclarationStatement operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitWhereQueryClause(Microsoft.CodeAnalysis.Semantics.IWhereQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitWhileUntilLoopStatement(Microsoft.CodeAnalysis.Semantics.IWhileUntilLoopStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitWithStatement(Microsoft.CodeAnalysis.Semantics.IWithStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitYieldBreakStatement(Microsoft.CodeAnalysis.Semantics.IReturnStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.DefaultVisit(Microsoft.CodeAnalysis.IOperation operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Visit(Microsoft.CodeAnalysis.IOperation operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAddressOfExpression(Microsoft.CodeAnalysis.Semantics.IAddressOfExpression operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAggregateQueryClause(Microsoft.CodeAnalysis.Semantics.IAggregateQueryClause operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAggregationExpression(Microsoft.CodeAnalysis.Semantics.IAggregationExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAnonymousObjectCreationExpression(Microsoft.CodeAnalysis.Semantics.IAnonymousObjectCreationExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitArgument(Microsoft.CodeAnalysis.Semantics.IArgument operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitArrayCreationExpression(Microsoft.CodeAnalysis.Semantics.IArrayCreationExpression operation, TArgument argument) -> TResult @@ -872,6 +948,7 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Vi virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDeclarationPattern(Microsoft.CodeAnalysis.Semantics.IDeclarationPattern operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDefaultCaseClause(Microsoft.CodeAnalysis.Semantics.IDefaultCaseClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDefaultValueExpression(Microsoft.CodeAnalysis.Semantics.IDefaultValueExpression operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDistinctQueryClause(Microsoft.CodeAnalysis.Semantics.IDistinctQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDynamicMemberReferenceExpression(Microsoft.CodeAnalysis.Semantics.IDynamicMemberReferenceExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDynamicObjectCreationExpression(Microsoft.CodeAnalysis.Semantics.IDynamicObjectCreationExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitEmptyStatement(Microsoft.CodeAnalysis.Semantics.IEmptyStatement operation, TArgument argument) -> TResult @@ -884,6 +961,9 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Vi virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitFixedStatement(Microsoft.CodeAnalysis.Semantics.IFixedStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitForEachLoopStatement(Microsoft.CodeAnalysis.Semantics.IForEachLoopStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitForLoopStatement(Microsoft.CodeAnalysis.Semantics.IForLoopStatement operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitFromQueryClause(Microsoft.CodeAnalysis.Semantics.IFromQueryClause operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitGroupByQueryClause(Microsoft.CodeAnalysis.Semantics.IGroupByQueryClause operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitGroupJoinQueryClause(Microsoft.CodeAnalysis.Semantics.IGroupJoinQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIfStatement(Microsoft.CodeAnalysis.Semantics.IIfStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIncrementExpression(Microsoft.CodeAnalysis.Semantics.IIncrementExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitInstanceReferenceExpression(Microsoft.CodeAnalysis.Semantics.IInstanceReferenceExpression operation, TArgument argument) -> TResult @@ -895,8 +975,11 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Vi virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitInvocationExpression(Microsoft.CodeAnalysis.Semantics.IInvocationExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIsPatternExpression(Microsoft.CodeAnalysis.Semantics.IIsPatternExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIsTypeExpression(Microsoft.CodeAnalysis.Semantics.IIsTypeExpression operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitJoinIntoQueryClause(Microsoft.CodeAnalysis.Semantics.IJoinIntoQueryClause operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitJoinQueryClause(Microsoft.CodeAnalysis.Semantics.IJoinQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLabelStatement(Microsoft.CodeAnalysis.Semantics.ILabelStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLambdaExpression(Microsoft.CodeAnalysis.Semantics.ILambdaExpression operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLetQueryClause(Microsoft.CodeAnalysis.Semantics.ILetQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLiteralExpression(Microsoft.CodeAnalysis.Semantics.ILiteralExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLocalFunctionStatement(Microsoft.CodeAnalysis.Semantics.ILocalFunctionStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLocalReferenceExpression(Microsoft.CodeAnalysis.Semantics.ILocalReferenceExpression operation, TArgument argument) -> TResult @@ -908,6 +991,8 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Vi virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitObjectCreationExpression(Microsoft.CodeAnalysis.Semantics.IObjectCreationExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitObjectOrCollectionInitializerExpression(Microsoft.CodeAnalysis.Semantics.IObjectOrCollectionInitializerExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitOmittedArgumentExpression(Microsoft.CodeAnalysis.Semantics.IOmittedArgumentExpression operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitOrderByQueryClause(Microsoft.CodeAnalysis.Semantics.IOrderByQueryClause operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitOrderingExpression(Microsoft.CodeAnalysis.Semantics.IOrderingExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitParameterInitializer(Microsoft.CodeAnalysis.Semantics.IParameterInitializer operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitParameterReferenceExpression(Microsoft.CodeAnalysis.Semantics.IParameterReferenceExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitParenthesizedExpression(Microsoft.CodeAnalysis.Semantics.IParenthesizedExpression operation, TArgument argument) -> TResult @@ -916,16 +1001,23 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Vi virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPointerIndirectionReferenceExpression(Microsoft.CodeAnalysis.Semantics.IPointerIndirectionReferenceExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPropertyInitializer(Microsoft.CodeAnalysis.Semantics.IPropertyInitializer operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPropertyReferenceExpression(Microsoft.CodeAnalysis.Semantics.IPropertyReferenceExpression operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitQueryContinuation(Microsoft.CodeAnalysis.Semantics.IQueryContinuation operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitQueryExpression(Microsoft.CodeAnalysis.Semantics.IQueryExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitRangeCaseClause(Microsoft.CodeAnalysis.Semantics.IRangeCaseClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitRelationalCaseClause(Microsoft.CodeAnalysis.Semantics.IRelationalCaseClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitReturnStatement(Microsoft.CodeAnalysis.Semantics.IReturnStatement operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSelectQueryClause(Microsoft.CodeAnalysis.Semantics.ISelectQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSimpleAssignmentExpression(Microsoft.CodeAnalysis.Semantics.ISimpleAssignmentExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSingleValueCaseClause(Microsoft.CodeAnalysis.Semantics.ISingleValueCaseClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSizeOfExpression(Microsoft.CodeAnalysis.Semantics.ISizeOfExpression operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSkipQueryClause(Microsoft.CodeAnalysis.Semantics.ISkipQueryClause operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSkipWhileQueryClause(Microsoft.CodeAnalysis.Semantics.ISkipWhileQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitStopStatement(Microsoft.CodeAnalysis.Semantics.IStopStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSwitchCase(Microsoft.CodeAnalysis.Semantics.ISwitchCase operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSwitchStatement(Microsoft.CodeAnalysis.Semantics.ISwitchStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSyntheticLocalReferenceExpression(Microsoft.CodeAnalysis.Semantics.ISyntheticLocalReferenceExpression operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTakeQueryClause(Microsoft.CodeAnalysis.Semantics.ITakeQueryClause operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTakeWhileQueryClause(Microsoft.CodeAnalysis.Semantics.ITakeWhileQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitThrowExpression(Microsoft.CodeAnalysis.Semantics.IThrowExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitThrowStatement(Microsoft.CodeAnalysis.Semantics.IThrowStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTryStatement(Microsoft.CodeAnalysis.Semantics.ITryStatement operation, TArgument argument) -> TResult @@ -936,6 +1028,7 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Vi virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitUsingStatement(Microsoft.CodeAnalysis.Semantics.IUsingStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitVariableDeclaration(Microsoft.CodeAnalysis.Semantics.IVariableDeclaration operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitVariableDeclarationStatement(Microsoft.CodeAnalysis.Semantics.IVariableDeclarationStatement operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitWhereQueryClause(Microsoft.CodeAnalysis.Semantics.IWhereQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitWhileUntilLoopStatement(Microsoft.CodeAnalysis.Semantics.IWhileUntilLoopStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitWithStatement(Microsoft.CodeAnalysis.Semantics.IWithStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitYieldBreakStatement(Microsoft.CodeAnalysis.Semantics.IReturnStatement operation, TArgument argument) -> TResult diff --git a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb index f85acf40829e9..e7beebd3b0423 100644 --- a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb +++ b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb @@ -4,6 +4,7 @@ Imports System.Collections.Concurrent Imports System.Collections.Immutable Imports Microsoft.CodeAnalysis.PooledObjects Imports Microsoft.CodeAnalysis.VisualBasic +Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.Semantics Partial Friend NotInheritable Class VisualBasicOperationFactory @@ -182,6 +183,30 @@ Namespace Microsoft.CodeAnalysis.Semantics Return Create(DirectCast(boundNode, BoundAnonymousTypeFieldInitializer).Value) Case BoundKind.AnonymousTypePropertyAccess Return CreateBoundAnonymousTypePropertyAccessOperation(DirectCast(boundNode, BoundAnonymousTypePropertyAccess)) + Case BoundKind.QueryExpression + Return CreateBoundQueryExpressionOperation(DirectCast(boundNode, BoundQueryExpression)) + Case BoundKind.QueryClause + Return CreateBoundQueryClauseOperation(DirectCast(boundNode, BoundQueryClause)) + Case BoundKind.QueryableSource + Return CreateBoundQueryableSourceOperation(DirectCast(boundNode, BoundQueryableSource)) + Case BoundKind.AggregateClause + Return CreateBoundAggregateClauseOperation(DirectCast(boundNode, BoundAggregateClause)) + Case BoundKind.Ordering + Return CreateBoundOrderingOperation(DirectCast(boundNode, BoundOrdering)) + Case BoundKind.GroupAggregation + Return CreateBoundGroupAggregationOperation((DirectCast(boundNode, BoundGroupAggregation))) + Case BoundKind.QuerySource + ' Query source has no special representation in the IOperation tree + Return Create(DirectCast(boundNode, BoundQuerySource).Expression) + Case BoundKind.ToQueryableCollectionConversion + ' Queryable collection conversion has no special representation in the IOperation tree + Return Create(DirectCast(boundNode, BoundToQueryableCollectionConversion).ConversionCall) + Case BoundKind.QueryLambda + ' Query lambda has no special representation in the IOperation tree + Return Create(DirectCast(boundNode, BoundQueryLambda).Expression) + Case BoundKind.RangeVariableAssignment + ' Range variable assignment has no special representation in the IOperation tree + Return Create(DirectCast(boundNode, BoundRangeVariableAssignment).Value) Case Else Dim constantValue = ConvertToOptional(TryCast(boundNode, BoundExpression)?.ConstantValueOpt) Return Operation.CreateOperationNone(boundNode.Syntax, constantValue, Function() GetIOperationChildren(boundNode)) @@ -1094,6 +1119,140 @@ Namespace Microsoft.CodeAnalysis.Semantics Dim constantValue As [Optional](Of Object) = ConvertToOptional(boundAnonymousTypePropertyAccess.ConstantValueOpt) Return New LazyPropertyReferenceExpression([property], instance, member, argumentsInEvaluationOrder, syntax, type, constantValue) End Function + + Private Function CreateBoundQueryExpressionOperation(boundQueryExpression As BoundQueryExpression) As IQueryExpression + Dim lastClauseOrContinuation As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundQueryExpression.LastOperator)) + Dim syntax As SyntaxNode = boundQueryExpression.Syntax + Dim type As ITypeSymbol = boundQueryExpression.Type + Dim constantValue As [Optional](Of Object) = ConvertToOptional(boundQueryExpression.ConstantValueOpt) + Return New LazyQueryExpression(lastClauseOrContinuation, syntax, type, constantValue) + End Function + + Private Function CreateBoundQueryClauseOperation(boundQueryClause As BoundQueryClause) As IOperation + Return CreateBoundQueryClauseOperation(boundQueryClause, boundQueryClause.UnderlyingExpression) + End Function + + Private Function CreateBoundQueryableSourceOperation(boundQueryClause As BoundQueryableSource) As IOperation + Return CreateBoundQueryClauseOperation(boundQueryClause, boundQueryClause.Source) + End Function + + Private Function CreateBoundQueryClauseOperation(boundQueryClause As BoundQueryClauseBase, underlyingExpression As BoundExpression) As IOperation + Dim syntax As SyntaxNode = boundQueryClause.Syntax + Dim clauseSyntaxKind = syntax.Kind + + If boundQueryClause.WasCompilerGenerated AndAlso clauseSyntaxKind = SyntaxKind.FromClause Then + ' Handle implicit select clause + ' VB generates bound query clause with From syntax only for implicit select. + ' The actual from clauses are generated for the underlying range variable declaration syntax nodes + clauseSyntaxKind = SyntaxKind.SelectClause + ElseIf clauseSyntaxKind = SyntaxKind.ExpressionRangeVariable OrElse clauseSyntaxKind = SyntaxKind.CollectionRangeVariable Then + ' VB Binder does not generate a bound node for few query clause syntax nodes (From and Let in the current implementation). + ' So we generate an Operation node for such nodes when we encounter the bound node for the first range variable child. + If IsFirstRangeVariableChildWhoseParentHasNoBoundNode(boundQueryClause) Then + syntax = syntax.Parent + clauseSyntaxKind = syntax.Kind + Else + ' Currently we do not generate IOperation nodes for range variable declarations. + Return Create(underlyingExpression) + End If + End If + + Dim reducedExpression As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(underlyingExpression)) + Dim type As ITypeSymbol = boundQueryClause.Type + Dim constantValue As [Optional](Of Object) = ConvertToOptional(boundQueryClause.ConstantValueOpt) + + Select Case clauseSyntaxKind + Case SyntaxKind.FromClause + Return New LazyFromQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.SelectClause + Return New LazySelectQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.WhereClause + Return New LazyWhereQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.LetClause + Return New LazyLetQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.OrderByClause + Return New LazyOrderByQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.GroupByClause + Return New LazyGroupByQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.GroupJoinClause + Return New LazyGroupJoinQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.SimpleJoinClause + Return New LazyJoinQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.DistinctClause + Return New LazyDistinctQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.AggregateClause + Return New LazyAggregateQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.SkipClause + Return New LazySkipQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.SkipWhileClause + Return New LazySkipWhileQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.TakeClause + Return New LazyTakeQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.TakeWhileClause + Return New LazyTakeWhileQueryClause(reducedExpression, syntax, type, constantValue) + Case SyntaxKind.FunctionAggregation + Return New LazyAggregationExpression(reducedExpression, isGroupAggregation:=False, syntax:=syntax, type:=type, constantValue:=constantValue) + Case Else + Throw ExceptionUtilities.Unreachable + End Select + End Function + + Private Function IsFirstRangeVariableChildWhoseParentHasNoBoundNode(boundQueryClause As BoundQueryClauseBase) As Boolean + ' VB Binder does not generate a bound node for few query clause syntax nodes (From and Let in the current implementation). + ' So we generate an Operation node for such nodes when we encounter the bound node for the first range variable child. + Select Case boundQueryClause.Syntax.Parent.Kind + Case SyntaxKind.FromClause, SyntaxKind.LetClause + Return IsFirstRangeVariableChild(boundQueryClause) + Case Else + Return False + End Select + End Function + + Private Function IsFirstRangeVariableChild(boundQueryClause As BoundQueryClauseBase) As Boolean + Select Case boundQueryClause.Syntax.Kind + Case SyntaxKind.ExpressionRangeVariable, SyntaxKind.CollectionRangeVariable + Return boundQueryClause.Syntax.Parent.ChildNodes().First Is boundQueryClause.Syntax + Case Else + Return False + End Select + End Function + + Private Function CreateBoundAggregateClauseOperation(boundAggregateClause As BoundAggregateClause) As IAggregateQueryClause + Dim reducedExpression As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundAggregateClause.UnderlyingExpression)) + Dim syntax As SyntaxNode = boundAggregateClause.Syntax + Dim type As ITypeSymbol = boundAggregateClause.Type + Dim constantValue As [Optional](Of Object) = ConvertToOptional(boundAggregateClause.ConstantValueOpt) + Return New LazyAggregateQueryClause(reducedExpression, syntax, type, constantValue) + End Function + + Private Function CreateBoundOrderingOperation(boundOrdering As BoundOrdering) As IOrderingExpression + Dim expression As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundOrdering.UnderlyingExpression)) + Dim orderKind = GetOrderKind(DirectCast(boundOrdering.Syntax, OrderingSyntax)) + Dim syntax As SyntaxNode = boundOrdering.Syntax + Dim type As ITypeSymbol = boundOrdering.Type + Dim constantValue As [Optional](Of Object) = ConvertToOptional(boundOrdering.ConstantValueOpt) + Return New LazyOrderingExpression(expression, orderKind, syntax, type, constantValue) + End Function + + Private Shared Function GetOrderKind(orderingSyntax As OrderingSyntax) As OrderKind + Select Case orderingSyntax.Kind + Case SyntaxKind.AscendingOrdering + Return OrderKind.Ascending + Case SyntaxKind.DescendingOrdering + Return OrderKind.Descending + Case Else + Return OrderKind.None + End Select + End Function + + Private Function CreateBoundGroupAggregationOperation(boundGroupAggregation As BoundGroupAggregation) As IAggregationExpression + Dim expression As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundGroupAggregation.Group)) + Dim isGroupAggregation = True + Dim syntax As SyntaxNode = boundGroupAggregation.Syntax + Dim type As ITypeSymbol = boundGroupAggregation.Type + Dim constantValue As [Optional](Of Object) = ConvertToOptional(boundGroupAggregation.ConstantValueOpt) + Return New LazyAggregationExpression(expression, isGroupAggregation, syntax, type, constantValue) + End Function End Class End Namespace diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb index b3fbc808e911c..aee5c8d2cf33f 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb @@ -1,4 +1,4 @@ -' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.Semantics Imports Microsoft.CodeAnalysis.Test.Utilities @@ -86,28 +86,19 @@ End Class ]]>.Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -133,27 +124,18 @@ Class C End Class]]>.Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -180,28 +162,20 @@ End Class]]>.Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -227,49 +201,33 @@ Class C End Class]]>.Value Dim expectedOperationTree = , )(keySelector As System.Func(Of System.String, ), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.String), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By w ... nto Count()') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.String)) (Syntax: 'y In x') - Operand: IOperation: (OperationKind.None) (Syntax: 'y In x') - Children(1): - IOperation: (OperationKind.None) (Syntax: 'x') - Children(1): - IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.String()) (Syntax: 'x') - Arguments(2): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'x') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.String, )) (Syntax: 'x') - Operand: IOperation: (OperationKind.None) (Syntax: 'x') - Children(1): - IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By w ... nto Count()') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 'w = x') - Children(1): - IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.String()) (Syntax: 'x') - IOperation: (OperationKind.None) (Syntax: 'z = y') - Children(1): - IOperation: (OperationKind.None) (Syntax: 'y') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By w ... nto Count()') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.String), )) (Syntax: 'Group By w ... nto Count()') - Operand: IOperation: (OperationKind.None) (Syntax: 'Group By w ... nto Count()') - Children(1): - IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By w ... nto Count()') - Initializers(3): - IOperation: (OperationKind.None) (Syntax: 'w') - IOperation: (OperationKind.None) (Syntax: 'z') - IOperation: (OperationKind.None) (Syntax: 'Count()') - Children(1): - IOperation: (OperationKind.None) (Syntax: 'Count()') - Children(1): - IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.String).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') - Instance Receiver: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.String)) (Syntax: 'Group By w ... nto Count()') - Arguments(0) - InConversion: null - OutConversion: null +IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'From y In x ... nto Count()') + LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group By w ... nto Count()') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.String).GroupBy(Of , )(keySelector As System.Func(Of System.String, ), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.String), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By w ... nto Count()') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.String)) (Syntax: 'y In x') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From y In x') + ReducedExpression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.String()) (Syntax: 'x') + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'x') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.String, )) (Syntax: 'x') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By w ... nto Count()') + Initializers(2): + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.String()) (Syntax: 'x') + IOperation: (OperationKind.None) (Syntax: 'y') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By w ... nto Count()') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.String), )) (Syntax: 'Group By w ... nto Count()') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By w ... nto Count()') + Initializers(3): + IOperation: (OperationKind.None) (Syntax: 'w') + IOperation: (OperationKind.None) (Syntax: 'z') + IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Count()') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.String).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') + Instance Receiver: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.String)) (Syntax: 'Group By w ... nto Count()') + Arguments(0) + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty diff --git a/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb b/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb index aa3b395c1cfb0..4812d1916e38c 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb @@ -1,6 +1,7 @@ ' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.VisualBasic +Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Roslyn.Test.Utilities Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Semantics @@ -40,6 +41,47 @@ Select ]]>) End Sub + + Public Sub ImplicitSelectClause_IOperation() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub Test2() Dim compilationDef = @@ -84,6 +126,67 @@ Where End Sub + + Public Sub WhereClause_IOperation() + Dim source = 0 + System.Console.WriteLine("-----") + Dim q2 As Object = From s In q Where s > 0 Where 10 > s'BIND:"From s In q Where s > 0 Where 10 > s" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = s') + Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... here 10 > s') + LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where 10 > s') + ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where 10 > s') + Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where s > 0') + ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where s > 0') + Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') + ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IOperation: (OperationKind.None) (Syntax: 's') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') + Left: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + Right: IOperation: (OperationKind.None) (Syntax: 's') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub Test3() Dim compilationDef = @@ -123,11 +226,70 @@ Where System.Func`2[System.Int32,System.Boolean] End Sub + + Public Sub WhereClause02_IOperation() + Dim source = 0 + System.Console.WriteLine("-----") + Dim q2 As Object = From s In q Where s > 0 Where 10 > s'BIND:"From s In q Where s > 0 Where 10 > s" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = s') + Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... here 10 > s') + LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where 10 > s') + ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where 10 > s') + Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where s > 0') + ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where s > 0') + Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') + ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IOperation: (OperationKind.None) (Syntax: 's') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') + Left: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + Right: IOperation: (OperationKind.None) (Syntax: 's') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub Test4() - Dim compilationDef = - - + Dim source = 0 - End Sub -End Module - - - - Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) - - CompilationUtils.AssertTheseDiagnostics(compilation, - + Dim q1 As Object = From s In q Where s > 0'BIND:"From s In q Where s > 0" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = 0') + Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble, IsInvalid) (Syntax: 'From s In q Where s > 0') + LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Where s > 0') + ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble, IsInvalid) (Syntax: 'Where s > 0') + Children(2): + IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Where s > 0') + IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IOperation: (OperationKind.None) (Syntax: 's') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') +]]>.Value + + Dim expectedDiagnostics = 0 + Dim q1 As Object = From s In q Where s > 0'BIND:"From s In q Where s > 0" ~~~~~ BC36594: Definition of method 'Where' is not accessible in this context. - Dim q1 As Object = From s In q Where s > 0 + Dim q1 As Object = From s In q Where s > 0'BIND:"From s In q Where s > 0" ~~~~~ -) +]]>.Value + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub Test5() - Dim compilationDef = - - + Dim source = 0 - End Sub -End Module - - - - Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) - - CompilationUtils.AssertTheseDiagnostics(compilation, - + Dim q1 As Object = From s In q Where s > 0'BIND:"From s In q Where s > 0" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = 0') + Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble, IsInvalid) (Syntax: 'From s In q Where s > 0') + LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Where s > 0') + ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble, IsInvalid) (Syntax: 'Where s > 0') + Children(2): + IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Where s > 0') + IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IOperation: (OperationKind.None) (Syntax: 's') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') +]]>.Value + + Dim expectedDiagnostics = 0 + Dim q1 As Object = From s In q Where s > 0'BIND:"From s In q Where s > 0" ~~~~~ BC32050: Type parameter 'U' for 'Public Function Where(Of T, U)(x As Func(Of Integer, Boolean)) As QueryAble' cannot be inferred. - Dim q1 As Object = From s In q Where s > 0 + Dim q1 As Object = From s In q Where s > 0'BIND:"From s In q Where s > 0" ~~~~~ BC36594: Definition of method 'Where' is not accessible in this context. - Dim q1 As Object = From s In q Where s > 0 + Dim q1 As Object = From s In q Where s > 0'BIND:"From s In q Where s > 0" ~~~~~ -) +]]>.Value + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub Test6() - Dim compilationDef = - - + Dim source = 0 - End Sub -End Module - - - - Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) - - CompilationUtils.AssertTheseDiagnostics(compilation, - + Dim q1 As Object = From s In q Where s > 0'BIND:"From s In q Where s > 0" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = 0') + Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble, IsInvalid) (Syntax: 'From s In q Where s > 0') + LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Where s > 0') + ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble, IsInvalid) (Syntax: 'Where s > 0') + Children(2): + IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Where s > 0') + IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IOperation: (OperationKind.None) (Syntax: 's') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') +]]>.Value + + Dim expectedDiagnostics = 0 + Dim q1 As Object = From s In q Where s > 0'BIND:"From s In q Where s > 0" ~~~~~ BC36648: Data type(s) of the type parameter(s) in method 'Public Function Where(Of T, U)(x As Func(Of T, Action(Of U))) As QueryAble' cannot be inferred from these arguments. - Dim q1 As Object = From s In q Where s > 0 + Dim q1 As Object = From s In q Where s > 0'BIND:"From s In q Where s > 0" ~~~~~ -) +]]>.Value + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub @@ -333,6 +515,104 @@ AsQueryable End Sub + + Public Sub MultipleSelectClauses_IOperation() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub Test8() Dim compilationDef = @@ -1782,6 +2062,178 @@ True End Sub + + Public Sub Select1_IOperation() + Dim source = 0 + Select Num1() + Where Num1 = -10 + Select Module1.Num2() + Where Num2 = -10 + Num1() + Select ind!Two + Where Two > 0 + + System.Console.WriteLine() + System.Console.WriteLine("-----") + End Sub +End Module]]>.Value + + Dim expectedOperationTree = 0') + Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... ere Two > 0') + LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where Two > 0') + ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where Two > 0') + Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select ind!Two') + ReducedExpression: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select ind!Two') + Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where Num2 ... 10 + Num1()') + ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where Num2 ... 10 + Num1()') + Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select Module1.Num2()') + ReducedExpression: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select Module1.Num2()') + Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where Num1 = -10') + ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where Num1 = -10') + Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select Num1()') + ReducedExpression: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select Num1()') + Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where s > 0') + ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where s > 0') + Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select s') + ReducedExpression: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select s') + Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') + ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's') + Operand: IOperation: (OperationKind.None) (Syntax: 's') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IOperation: (OperationKind.None) (Syntax: 's') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Num1()') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'Num1()') + Operand: IInvocationExpression (Function Module1.Num1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Num1()') + Instance Receiver: null + Arguments(0) + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Num1 = -10') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Num1 = -10') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'Num1 = -10') + Left: IOperation: (OperationKind.None) (Syntax: 'Num1') + Right: IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, Constant: -10) (Syntax: '-10') + Operand: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Module1.Num2()') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'Module1.Num2()') + Operand: IInvocationExpression (Function Module1.Num2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Module1.Num2()') + Instance Receiver: null + Arguments(0) + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Num2 = -10 + Num1()') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Num2 = -10 + Num1()') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'Num2 = -10 + Num1()') + Left: IOperation: (OperationKind.None) (Syntax: 'Num2') + Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '-10 + Num1()') + Left: IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, Constant: -10) (Syntax: '-10') + Operand: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + Right: IInvocationExpression (Function Module1.Num1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Num1()') + Instance Receiver: null + Arguments(0) + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'ind!Two') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'ind!Two') + Operand: IPropertyReferenceExpression: Property Module1.Index.Item(x As System.String) As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'ind!Two') + Instance Receiver: ILocalReferenceExpression: ind (OperationKind.LocalReferenceExpression, Type: Module1.Index) (Syntax: 'ind') + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Two') + ILiteralExpression (Text: Two) (OperationKind.LiteralExpression, Type: System.String, Constant: "Two") (Syntax: 'Two') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Two > 0') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Two > 0') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'Two > 0') + Left: IOperation: (OperationKind.None) (Syntax: 'Two') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub Select2() Dim compilationDef = @@ -2497,9 +2949,7 @@ Where Public Sub Where1() - Dim compilationDef = - - + Dim source = - +End Module]]>.Value - Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) + Dim expectedOperationTree = .Value - CompilationUtils.AssertTheseDiagnostics(compilation, - + Dim expectedDiagnostics = ) +]]>.Value + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub @@ -3116,9 +3572,7 @@ BC42016: Implicit conversion from 'Boolean' to 'String'. Public Sub While1() - Dim compilationDef = - - + Dim source = 1 Dim q2 As Object = From s In q Skip While s > 1 End Sub -End Module - - - - Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) - - CompilationUtils.AssertTheseDiagnostics(compilation, - +End Module]]>.Value + + Dim expectedOperationTree = 1') + IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'q1') + Variables: Local_1: q1 As System.Object + Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q ... While s > 1') + Operand: IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'From s In q ... While s > 1') + LastClauseOrContinuation: ITakeWhileQueryClause (Clause kind: TakeWhileClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Take While s > 1') + ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Take While s > 1') + Children(2): + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') + ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 1') + Left: IOperation: (OperationKind.None) (Syntax: 's') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Dim q2 As O ... While s > 1') + IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'q2') + Variables: Local_1: q2 As System.Object + Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q ... While s > 1') + Operand: IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'From s In q ... While s > 1') + LastClauseOrContinuation: ISkipWhileQueryClause (Clause kind: SkipWhileClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Skip While s > 1') + ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Skip While s > 1') + Children(2): + IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') + ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 1') + Left: IOperation: (OperationKind.None) (Syntax: 's') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILabelStatement (Label: exit) (OperationKind.LabelStatement) (Syntax: 'End Sub') + LabeledStatement: null + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'End Sub') + ReturnedValue: null +]]>.Value + + Dim expectedDiagnostics = 1 ~~~~~~~~~~ BC36594: Definition of method 'SkipWhile' is not accessible in this context. Dim q2 As Object = From s In q Skip While s > 1 ~~~~~~~~~~ -) +]]>.Value + VerifyOperationTreeAndDiagnosticsForTest(Of MethodBlockSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub @@ -3213,11 +3706,211 @@ Select End Sub + + Public Sub SkipWhile_IOperation() + Dim source = 0'BIND:"From s In q Skip While s > 0" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = 0') + Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... While s > 0') + LastClauseOrContinuation: ISkipWhileQueryClause (Clause kind: SkipWhileClause) (OperationKind.QueryClause) (Syntax: 'Skip While s > 0') + ReducedExpression: IInvocationExpression ( Function QueryAble.SkipWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Skip While s > 0') + Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') + ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IOperation: (OperationKind.None) (Syntax: 's') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub TakeWhile_IOperation() + Dim source = 0'BIND:"From s In q Take While s > 0" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = 0') + Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... While s > 0') + LastClauseOrContinuation: ITakeWhileQueryClause (Clause kind: TakeWhileClause) (OperationKind.QueryClause) (Syntax: 'Take While s > 0') + ReducedExpression: IInvocationExpression ( Function QueryAble.TakeWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Take While s > 0') + Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') + ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IOperation: (OperationKind.None) (Syntax: 's') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub TakeWhileAndSkipWhile_IOperation() + Dim source = 0 Take While 10 > s Skip While s > 0 Select s'BIND:"From s In q Skip While s > 0 Take While 10 > s Skip While s > 0 Select s" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = 0') + ReducedExpression: IInvocationExpression ( Function QueryAble.SkipWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Skip While s > 0') + Instance Receiver: ITakeWhileQueryClause (Clause kind: TakeWhileClause) (OperationKind.QueryClause) (Syntax: 'Take While 10 > s') + ReducedExpression: IInvocationExpression ( Function QueryAble.TakeWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Take While 10 > s') + Instance Receiver: ISkipWhileQueryClause (Clause kind: SkipWhileClause) (OperationKind.QueryClause) (Syntax: 'Skip While s > 0') + ReducedExpression: IInvocationExpression ( Function QueryAble.SkipWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Skip While s > 0') + Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') + ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IOperation: (OperationKind.None) (Syntax: 's') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') + Left: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + Right: IOperation: (OperationKind.None) (Syntax: 's') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IOperation: (OperationKind.None) (Syntax: 's') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's') + Operand: IOperation: (OperationKind.None) (Syntax: 's') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub Distinct1() - Dim compilationDef = - - + Dim source = 1 Distinct End Sub -End Module - - +End Module]]>.Value - Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) + Dim expectedOperationTree = .Value - CompilationUtils.AssertTheseDiagnostics(compilation, - + Dim expectedDiagnostics = 1 Distinct ~~~~~~~~~~ -) +]]>.Value + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub @@ -3297,6 +3996,101 @@ Distinct End Sub + + Public Sub Distinct2_IOperation() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub MultipleDistinct_IOperation() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub SkipTake1() Dim compilationDef = @@ -3401,6 +4195,115 @@ Skip 2 ]]>) End Sub + + Public Sub Skip_IOperation() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub Take_IOperation() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub SkipTake3() Dim compilationDef = @@ -3777,6 +4680,286 @@ OrderBy 0 ]]>) End Sub + + Public Sub OrderByAscending_IOperation() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub OrderByDescending_IOperation() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub OrderByAscendingDescending_IOperation() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub OrderBy5() Dim compilationDef = @@ -4210,6 +5393,209 @@ End Module ]]>) End Sub + + Public Sub Let_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... s2 = s1 + 1') + LastClauseOrContinuation: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let s2 = s1 + 1') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of )(selector As System.Func(Of System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's2 = s1 + 1') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's2 = s1 + 1') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IOperation: (OperationKind.None) (Syntax: 's1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub LetMultipleVariables_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... 3 = s2 + s1') + LastClauseOrContinuation: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Select(Of )(selector As System.Func(Of , )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's3 = s2 + s1') + Instance Receiver: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let s2 = s1 ... 3 = s2 + s1') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of )(selector As System.Func(Of System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's2 = s1 + 1') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's2 = s1 + 1') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IOperation: (OperationKind.None) (Syntax: 's1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's2 + s1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , )) (Syntax: 's2 + s1') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's3 = s2 + s1') + Initializers(3): + IOperation: (OperationKind.None) (Syntax: 's1') + IOperation: (OperationKind.None) (Syntax: 's2') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 + s1') + Left: IOperation: (OperationKind.None) (Syntax: 's2') + Right: IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub LetMultipleClauses_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... 2 + s3 + s4') + LastClauseOrContinuation: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>, Key s4 As System.Int32>).Select(Of )(selector As System.Func(Of , Key s3 As System.Int32>, Key s4 As System.Int32>, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's5 = s1 + s2 + s3 + s4') + Instance Receiver: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let s4 = s1 ... 2 + s3 + s4') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>).Select(Of , Key s3 As System.Int32>, Key s4 As System.Int32>)(selector As System.Func(Of , Key s3 As System.Int32>, , Key s3 As System.Int32>, Key s4 As System.Int32>)) As System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>, Key s4 As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>, Key s4 As System.Int32>)) (Syntax: 's4 = s1 + s2 + s3') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Select(Of , Key s3 As System.Int32>)(selector As System.Func(Of , , Key s3 As System.Int32>)) As System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>)) (Syntax: 's3 = s2 + s1') + Instance Receiver: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let s2 = s1 ... 3 = s2 + s1') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of )(selector As System.Func(Of System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's2 = s1 + 1') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {3}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {3}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {3}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{3}') + Element Values(1): + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's2 = s1 + 1') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IOperation: (OperationKind.None) (Syntax: 's1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's2 + s1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , , Key s3 As System.Int32>)) (Syntax: 's2 + s1') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's3 = s2 + s1') + Initializers(2): + IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's3 = s2 + s1') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 + s1') + Left: IOperation: (OperationKind.None) (Syntax: 's2') + Right: IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + s2 + s3') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key s3 As System.Int32>, , Key s3 As System.Int32>, Key s4 As System.Int32>)) (Syntax: 's1 + s2 + s3') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's4 = s1 + s2 + s3') + Initializers(2): + IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's4 = s1 + s2 + s3') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2') + Left: IOperation: (OperationKind.None) (Syntax: 's1') + Right: IOperation: (OperationKind.None) (Syntax: 's2') + Right: IOperation: (OperationKind.None) (Syntax: 's3') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + s2 + s3 + s4') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key s3 As System.Int32>, Key s4 As System.Int32>, )) (Syntax: 's1 + s2 + s3 + s4') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's5 = s1 + s2 + s3 + s4') + Initializers(5): + IOperation: (OperationKind.None) (Syntax: 's1') + IOperation: (OperationKind.None) (Syntax: 's2') + IOperation: (OperationKind.None) (Syntax: 's3') + IOperation: (OperationKind.None) (Syntax: 's4') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2') + Left: IOperation: (OperationKind.None) (Syntax: 's1') + Right: IOperation: (OperationKind.None) (Syntax: 's2') + Right: IOperation: (OperationKind.None) (Syntax: 's3') + Right: IOperation: (OperationKind.None) (Syntax: 's4') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub Let2() Dim compilationDef = @@ -5647,6 +7033,179 @@ End Module ]]>) End Sub + + Public Sub Join_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... 1 Equals s2') + LastClauseOrContinuation: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join s2 In ... 1 Equals s2') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s2 In ... 1 Equals s2') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 3}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... er() {1, 3}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 3}') + Element Values(2): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{2, 3}') + Element Values(2): + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Operand: IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + Operand: IOperation: (OperationKind.None) (Syntax: 's2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s2 In ... 1 Equals s2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join s2 In ... 1 Equals s2') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s2 In ... 1 Equals s2') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IOperation: (OperationKind.None) (Syntax: 's2') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub JoinMultiple_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... uals s2 * 2') + LastClauseOrContinuation: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join s3 In ... uals s2 * 2') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s3 In ... uals s2 * 2') + Instance Receiver: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join s2 In ... 1 Equals s2') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s2 In ... 1 Equals s2') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{2, 3}') + Element Values(2): + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1 + 1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IOperation: (OperationKind.None) (Syntax: 's1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + Operand: IOperation: (OperationKind.None) (Syntax: 's2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s2 In ... 1 Equals s2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join s2 In ... 1 Equals s2') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s2 In ... 1 Equals s2') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2') + InConversion: null + OutConversion: null + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's3 In New I ... er() {4, 5}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New I ... er() {4, 5}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {4, 5}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {4, 5}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{4, 5}') + Element Values(2): + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + ILiteralExpression (Text: 5) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 5) (Syntax: '5') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's3') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's3') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 * 2') + Left: IOperation: (OperationKind.None) (Syntax: 's2') + Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2 * 2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2 * 2') + Operand: IOperation: (OperationKind.None) (Syntax: 's3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s3 In ... uals s2 * 2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join s3 In ... uals s2 * 2') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s3 In ... uals s2 * 2') + Initializers(3): + IOperation: (OperationKind.None) (Syntax: 's1') + IOperation: (OperationKind.None) (Syntax: 's2') + IOperation: (OperationKind.None) (Syntax: 's3') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub Join2() Dim compilationDef = @@ -6531,9 +8090,7 @@ Select System.Func`2[VB$AnonymousType_11`2[VB$AnonymousType_7`2[VB$AnonymousType Public Sub Join4() - Dim compilationDef = - - + Dim source = - - - Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) - - CompilationUtils.AssertTheseDiagnostics(compilation, - + Dim q0 As Object = From s1 In q Join t1 In q On s1 Equals t1'BIND:"From s1 In q Join t1 In q On s1 Equals t1" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = , IsInvalid) (Syntax: 'Join t1 In ... 1 Equals t1') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IOperation: (OperationKind.None) (Syntax: 't1') +]]>.Value + + Dim expectedDiagnostics = ) +]]>.Value + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub @@ -6710,6 +8281,383 @@ End Module ]]>) End Sub + + Public Sub GroupBy_GroupAggregation_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... Into Group') + LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group By s1 Into Group') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By s1 Into Group') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... 3, 4, 2, 3}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Initializer: IArrayInitializer (6 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2, 3, 4, 2, 3}') + Element Values(6): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Operand: IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By s1 Into Group') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By s1 Into Group') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By s1 Into Group') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group') + Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group By s1 Into Group') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub GroupBy_FunctionAggregation_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... nto Count()') + LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group By s1 Into Count()') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By s1 Into Count()') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... 3, 4, 2, 3}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Initializer: IArrayInitializer (6 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2, 3, 4, 2, 3}') + Element Values(6): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Operand: IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By s1 Into Count()') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By s1 Into Count()') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By s1 Into Count()') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Count()') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') + Instance Receiver: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group By s1 Into Count()') + Arguments(0) + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub GroupBy_WithOptionalGroupClause_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... Into Group') + LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group s1 By ... Into Group') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), elementSelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1 By ... Into Group') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... 3, 4, 2, 3}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Initializer: IArrayInitializer (6 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2, 3, 4, 2, 3}') + Element Values(6): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(3): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Operand: IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: elementSelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Operand: IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group s1 By ... Into Group') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group s1 By ... Into Group') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group s1 By ... Into Group') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group') + Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group s1 By ... Into Group') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub GroupBy_MultipleAggregations_IOperation() + Dim source = .Value + + Dim expectedOperationTree = ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'From s1 In ... (), Max(s1)') + LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group s1, s ... (), Max(s1)') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of , , ), Key c As System.Int32, Key Max As System.Int32>)(keySelector As System.Func(Of System.Int32, ), elementSelector As System.Func(Of System.Int32, ), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of ), ), Key c As System.Int32, Key Max As System.Int32>)) As System.Collections.Generic.IEnumerable(Of ), Key c As System.Int32, Key Max As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'Group s1, s ... (), Max(s1)') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... 3, 4, 2, 3}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Initializer: IArrayInitializer (6 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2, 3, 4, 2, 3}') + Element Values(6): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(3): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1 Mod 2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 Mod 2') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group s1, s ... (), Max(s1)') + Initializers(2): + IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 Mod 2') + Left: IOperation: (OperationKind.None) (Syntax: 's1') + Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 Mod 3') + Left: IOperation: (OperationKind.None) (Syntax: 's1') + Right: ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: elementSelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group s1, s ... (), Max(s1)') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IConversionExpression (ConversionKind.Basic, Explicit) (OperationKind.ConversionExpression, Type: System.String) (Syntax: 'CStr(s1)') + Operand: IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group s1, s ... (), Max(s1)') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of ), ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'Group s1, s ... (), Max(s1)') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ), Key c As System.Int32, Key Max As System.Int32>) (Syntax: 'Group s1, s ... (), Max(s1)') + Initializers(5): + IOperation: (OperationKind.None) (Syntax: 's1') + IOperation: (OperationKind.None) (Syntax: 's2') + IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group') + Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1, s ... (), Max(s1)') + IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Count()') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') + Instance Receiver: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1, s ... (), Max(s1)') + Arguments(0) + IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Max(s1)') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Max(selector As System.Func(Of , System.Int32)) As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Max(s1)') + Instance Receiver: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1, s ... (), Max(s1)') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's1') + Operand: IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub GroupBy_WithJoin_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... y Equals s1') + LastClauseOrContinuation: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join s1 In ... y Equals s1') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s1 In ... y Equals s1') + Instance Receiver: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group By ke ... Into Group') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By ke ... Into Group') + Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select s1 + 1') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of System.Int32)(selector As System.Func(Of System.Int32, System.Int32)) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Select s1 + 1') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 2}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... er() {1, 2}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 2}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 2}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2}') + Element Values(2): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IOperation: (OperationKind.None) (Syntax: 's1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: '1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: '1') + Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By ke ... Into Group') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By ke ... Into Group') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By ke ... Into Group') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 'key') + IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group') + Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group By ke ... Into Group') + InConversion: null + OutConversion: null + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's1 In New I ... er() {1, 2}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 2}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 2}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 2}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2}') + Element Values(2): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 'key') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 'key') + Operand: IOperation: (OperationKind.None) (Syntax: 'key') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Operand: IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s1 In ... y Equals s1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join s1 In ... y Equals s1') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s1 In ... y Equals s1') + Initializers(3): + IOperation: (OperationKind.None) (Syntax: 'key') + IOperation: (OperationKind.None) (Syntax: 'Group') + IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub GroupBy2() Dim compilationDef = @@ -6877,9 +8825,7 @@ BC36600: Range variable 's1' is already declared. Public Sub GroupBy3() - Dim compilationDef = - - + Dim source = - - - Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) - - CompilationUtils.AssertTheseDiagnostics(compilation, - + Dim q0 As Object = From s1 In q Group By s1 Into Group'BIND:"From s1 In q Group By s1 Into Group" + + Dim q1 As Object = From s1 In q Group s2 = s1 By s1 Into Group + End Sub +End Module]]>.Value + + Dim expectedOperationTree = , IsInvalid) (Syntax: 'Group By s1 Into Group') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: ?) (Syntax: 'Group') + Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: ?, IsInvalid) (Syntax: 'Group By s1 Into Group') +]]>.Value + + Dim expectedDiagnostics = ) +]]>.Value + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub @@ -7238,6 +9197,351 @@ End Module ]]>) End Sub + + Public Sub GroupJoin_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... Into Group') + LastClauseOrContinuation: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause) (Syntax: 'Group Join ... Into Group') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupJoin(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... Into Group') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 3}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... er() {1, 3}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 3}') + Element Values(2): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{2, 3}') + Element Values(2): + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Operand: IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + Operand: IOperation: (OperationKind.None) (Syntax: 's2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... Into Group') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... Into Group') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... Into Group') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group') + Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... Into Group') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub GroupJoin_Nested_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... gr2 = Group') + LastClauseOrContinuation: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause) (Syntax: 'Group Join ... gr2 = Group') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).GroupJoin(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... gr2 = Group') + Instance Receiver: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause) (Syntax: 'Group Join ... gr1 = Group') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupJoin(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... gr1 = Group') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{2, 3}') + Element Values(2): + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1 + 1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IOperation: (OperationKind.None) (Syntax: 's1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + Operand: IOperation: (OperationKind.None) (Syntax: 's2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... gr1 = Group') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... gr1 = Group') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... gr1 = Group') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group') + Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... gr1 = Group') + InConversion: null + OutConversion: null + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's3 In New I ... er() {4, 5}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New I ... er() {4, 5}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {4, 5}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {4, 5}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{4, 5}') + Element Values(2): + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + ILiteralExpression (Text: 5) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 5) (Syntax: '5') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's3') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's3') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '(s1 + 1) * 2') + Left: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Int32) (Syntax: '(s1 + 1)') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IOperation: (OperationKind.None) (Syntax: 's1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: '(s1 + 1) * 2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: '(s1 + 1) * 2') + Operand: IOperation: (OperationKind.None) (Syntax: 's3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... gr2 = Group') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... gr2 = Group') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... gr2 = Group') + Initializers(3): + IOperation: (OperationKind.None) (Syntax: 's1') + IOperation: (OperationKind.None) (Syntax: 'gr1') + IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group') + Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... gr2 = Group') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub GroupJoin_NestedJoin_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )>)) (Syntax: 'From s1 In ... s3 = Group') + LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... s3 = Group') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of )>).Select(Of )>)(selector As System.Func(Of )>, )>)) As System.Collections.Generic.IEnumerable(Of )>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )>)) (Syntax: 'From s1 In ... s3 = Group') + Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... s3 = Group') + ReducedExpression: IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable(Of )>)) (Syntax: 'From s1 In ... s3 = Group') + LastClauseOrContinuation: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause) (Syntax: 'Group Join ... s3 = Group') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupJoin(Of , System.Int32, )>)(inner As System.Collections.Generic.IEnumerable(Of ), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of , System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ), )>)) As System.Collections.Generic.IEnumerable(Of )>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )>)) (Syntax: 'Group Join ... s3 = Group') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'Join ... 2 Equals s4') + IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join ... 2 Equals s4') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join ... 2 Equals s4') + Instance Receiver: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join ... 2 Equals s3') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join ... 2 Equals s3') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New Integer() {1}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's3 In New Integer() {1}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New Integer() {1}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + Operand: IOperation: (OperationKind.None) (Syntax: 's2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's3') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's3') + Operand: IOperation: (OperationKind.None) (Syntax: 's3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join ... 2 Equals s3') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join ... 2 Equals s3') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join ... 2 Equals s3') + Initializers(2): + IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2') + IParameterReferenceExpression: s3 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's3') + InConversion: null + OutConversion: null + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's4 In New Integer() {1}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's4 In New Integer() {1}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's2') + Operand: IOperation: (OperationKind.None) (Syntax: 's2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's4') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's4') + Operand: IOperation: (OperationKind.None) (Syntax: 's4') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join ... 2 Equals s4') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join ... 2 Equals s4') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join ... 2 Equals s4') + Initializers(3): + IOperation: (OperationKind.None) (Syntax: 's2') + IOperation: (OperationKind.None) (Syntax: 's3') + IOperation: (OperationKind.None) (Syntax: 's4') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Operand: IOperation: (OperationKind.None) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's2') + Operand: IOperation: (OperationKind.None) (Syntax: 's2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... s3 = Group') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ), )>)) (Syntax: 'Group Join ... s3 = Group') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: )>) (Syntax: 'Group Join ... s3 = Group') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group') + Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... s3 = Group') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'From s1 In ... s3 = Group') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of )>, )>)) (Syntax: 'From s1 In ... s3 = Group') + Operand: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: )>) (Syntax: 's1') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub GroupJoin2() Dim compilationDef = @@ -8091,9 +10395,7 @@ BC36631: 'Join' expected. Public Sub GroupJoin5() - Dim compilationDef = - - + Dim source = - - - Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) - - CompilationUtils.AssertTheseDiagnostics(compilation, - + Dim q0 As Object = From s1 In q Group Join t1 In q On s1 Equals t1 Into Group'BIND:"From s1 In q Group Join t1 In q On s1 Equals t1 Into Group" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = ), IsInvalid) (Syntax: 'From s1 In ... Into Group') + LastClauseOrContinuation: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Group Join ... Into Group') + ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble(Of ), IsInvalid) (Syntax: 'Group Join ... Into Group') + Children(5): + IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Group Join ... Into Group') + ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble(Of System.Int32)) (Syntax: 'q') + IOperation: (OperationKind.None) (Syntax: 's1') + IOperation: (OperationKind.None) (Syntax: 't1') + IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , IsInvalid) (Syntax: 'Group Join ... Into Group') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 's1') + IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: ?) (Syntax: 'Group') + Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: ?, IsInvalid) (Syntax: 'Group Join ... Into Group') +]]>.Value + + Dim expectedDiagnostics = ) +]]>.Value + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub @@ -8256,6 +10572,453 @@ End Module ]]>) End Sub + + Public Sub AggregateClause_IOperation() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub AggregateClause_MultipleAggregations_IOperation() + Dim source = .Value + + Dim expectedOperationTree = ) (Syntax: 'Aggregate y ... Sum(y \ 2)') + LastClauseOrContinuation: IAggregateQueryClause (Clause kind: AggregateClause) (OperationKind.QueryClause) (Syntax: 'Aggregate y ... Sum(y \ 2)') + ReducedExpression: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Initializers(2): + IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Count()') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Operand: IPlaceholderExpression (OperationKind.PlaceholderExpression, Type: System.Int32()) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Arguments(0) + IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Sum(y \ 2)') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Sum(selector As System.Func(Of System.Int32, System.Int32)) As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Sum(y \ 2)') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Operand: IPlaceholderExpression (OperationKind.PlaceholderExpression, Type: System.Int32()) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'y \ 2') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'y \ 2') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'y \ 2') + Left: IOperation: (OperationKind.None) (Syntax: 'y') + Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub AggregateClause_WithWhereFilter_IOperation() + Dim source = y Into Sum(x + y))'BIND:"Aggregate x In New Integer() {3, 4}, y In New Integer() {1, 3} Where x > y Into Sum(x + y)" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = ).Sum(selector As System.Func(Of , System.Int32)) As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Sum(x + y)') + Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where x > y') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Where(predicate As System.Func(Of , System.Boolean)) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where x > y') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'y In New In ... er() {1, 3}') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New In ... er() {3, 4}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3, 4}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {3, 4}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{3, 4}') + Element Values(2): + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {1, 3}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {1, 3}') + Operand: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New In ... er() {1, 3}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 3}') + Element Values(2): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Sum(x + y)') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Sum(x + y)') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'y In New In ... er() {1, 3}') + Initializers(2): + IOperation: (OperationKind.None) (Syntax: 'x') + IOperation: (OperationKind.None) (Syntax: 'y') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'x > y') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'x > y') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'x > y') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IOperation: (OperationKind.None) (Syntax: 'y') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + y') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 'x + y') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IOperation: (OperationKind.None) (Syntax: 'y') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub AggregateClause_MultipleRangeVariableDeclarations_IOperation() + Dim source = .Value + + Dim expectedOperationTree = )) (Syntax: 'Aggregate x ... Where(True)') + LastClauseOrContinuation: IAggregateQueryClause (Clause kind: AggregateClause) (OperationKind.QueryClause) (Syntax: 'Aggregate x ... Where(True)') + ReducedExpression: IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Where(predicate As System.Func(Of , System.Boolean)) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'z In New Integer() {3}') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'y In New Integer() {2}') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New Integer() {1}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {2}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {2}') + Operand: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New Integer() {2}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {2}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{2}') + Element Values(1): + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'y In New Integer() {2}') + Initializers(2): + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') + IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'y') + InConversion: null + OutConversion: null + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {3}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {3}') + Operand: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'z In New Integer() {3}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {3}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{3}') + Element Values(1): + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'z In New Integer() {3}') + Initializers(3): + IOperation: (OperationKind.None) (Syntax: 'x') + IOperation: (OperationKind.None) (Syntax: 'y') + IOperation: (OperationKind.None) (Syntax: 'z') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'True') + Operand: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub AggregateClause_WithDifferentClauses_IOperation() + Dim source = .Value + + Dim expectedOperationTree = ))) (Syntax: 'From x In N ... Where(True)') + LastClauseOrContinuation: IAggregateQueryClause (Clause kind: AggregateClause) (OperationKind.QueryClause) (Syntax: 'Aggregate x ... Where(True)') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of System.Collections.Generic.IEnumerable(Of ))(selector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ))) As System.Collections.Generic.IEnumerable(Of System.Collections.Generic.IEnumerable(Of ))) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Collections.Generic.IEnumerable(Of ))) (Syntax: 'Aggregate x ... Where(True)') + Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select x + 1') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of System.Int32)(selector As System.Func(Of System.Int32, System.Int32)) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Select x + 1') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New In ... er() {3, 4}') + Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From x In N ... er() {3, 4}') + ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3, 4}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {3, 4}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{3, 4}') + Element Values(2): + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + 1') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'x + 1') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + 1') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'New Integer() {1}') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ))) (Syntax: 'New Integer() {1}') + Operand: IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Where(predicate As System.Func(Of , System.Boolean)) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') + Instance Receiver: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let w = x + y + z') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Select(Of )(selector As System.Func(Of , )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'w = x + y + z') + Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select x, y, z') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Select(Of )(selector As System.Func(Of , Key z As System.Int32>, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Select x, y, z') + Instance Receiver: ITakeQueryClause (Clause kind: TakeClause) (OperationKind.QueryClause) (Syntax: 'Take 100') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Take(count As System.Int32) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Take 100') + Instance Receiver: ISkipQueryClause (Clause kind: SkipClause) (OperationKind.QueryClause) (Syntax: 'Skip 0') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Skip(count As System.Int32) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Skip 0') + Instance Receiver: ISkipWhileQueryClause (Clause kind: SkipWhileClause) (OperationKind.QueryClause) (Syntax: 'Skip While False') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).SkipWhile(predicate As System.Func(Of , Key z As System.Int32>, System.Boolean)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Skip While False') + Instance Receiver: ITakeWhileQueryClause (Clause kind: TakeWhileClause) (OperationKind.QueryClause) (Syntax: 'Take While True') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).TakeWhile(predicate As System.Func(Of , Key z As System.Int32>, System.Boolean)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Take While True') + Instance Receiver: IDistinctQueryClause (Clause kind: DistinctClause) (OperationKind.QueryClause) (Syntax: 'Distinct') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Distinct() As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Distinct') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Order By x') + Operand: IOrderByQueryClause (Clause kind: OrderByClause) (OperationKind.QueryClause) (Syntax: 'Order By x') + ReducedExpression: IOrderingExpression (Order kind: Ascending) (OperationKind.OrderingExpression, Type: System.Linq.IOrderedEnumerable(Of , Key z As System.Int32>)) (Syntax: 'x') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).OrderBy(Of System.Int32)(keySelector As System.Func(Of , Key z As System.Int32>, System.Int32)) As System.Linq.IOrderedEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Linq.IOrderedEnumerable(Of , Key z As System.Int32>)) (Syntax: 'x') + Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where True') + ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Where(predicate As System.Func(Of , Key z As System.Int32>, System.Boolean)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Where True') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).SelectMany(Of System.Int32, , Key z As System.Int32>)(collectionSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of , System.Int32, , Key z As System.Int32>)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'z In New Integer() {3}') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'y In New Integer() {2}') + Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New Integer() {1}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {2}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {2}') + Operand: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New Integer() {2}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {2}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{2}') + Element Values(1): + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'y In New Integer() {2}') + Initializers(2): + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') + IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'y') + InConversion: null + OutConversion: null + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {3}') + IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {3}') + Operand: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'z In New Integer() {3}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {3}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{3}') + Element Values(1): + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, , Key z As System.Int32>)) (Syntax: 'Aggregate x ... Where(True)') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , Key z As System.Int32>) (Syntax: 'z In New Integer() {3}') + Initializers(2): + IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'z In New Integer() {3}') + IParameterReferenceExpression: z (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'z') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'True') + Operand: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'x') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Int32)) (Syntax: 'x') + Operand: IOperation: (OperationKind.None) (Syntax: 'x') + InConversion: null + OutConversion: null + Arguments(0) + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'True') + Operand: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'False') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'False') + Operand: ILiteralExpression (Text: False) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: False) (Syntax: 'False') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: count) (OperationKind.Argument) (Syntax: '0') + ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: count) (OperationKind.Argument) (Syntax: '100') + ILiteralExpression (Text: 100) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 100) (Syntax: '100') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, )) (Syntax: 'x') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Select x, y, z') + Initializers(3): + IOperation: (OperationKind.None) (Syntax: 'x') + IOperation: (OperationKind.None) (Syntax: 'y') + IOperation: (OperationKind.None) (Syntax: 'z') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + y + z') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , )) (Syntax: 'x + y + z') + Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'w = x + y + z') + Initializers(4): + IOperation: (OperationKind.None) (Syntax: 'x') + IOperation: (OperationKind.None) (Syntax: 'y') + IOperation: (OperationKind.None) (Syntax: 'z') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y + z') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IOperation: (OperationKind.None) (Syntax: 'y') + Right: IOperation: (OperationKind.None) (Syntax: 'z') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') + IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'True') + Operand: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + Public Sub Aggregate2() Dim compilationDef = @@ -8517,9 +11280,7 @@ BC36617: Aggregate function name cannot be used with a type character. Public Sub Aggregate2b() - Dim compilationDef = - - + Dim source = - +End Module]]>.Value - Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, - additionalRefs:={SystemCoreRef}) + Dim expectedOperationTree = .Value - CompilationUtils.AssertTheseDiagnostics(compilation, - + Dim expectedDiagnostics = ) +]]>.Value + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub Aggregate2c() - Dim compilationDef = - - + Dim source = - +End Module]]>.Value - Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, - additionalRefs:={SystemCoreRef}) + Dim expectedOperationTree = .Value - CompilationUtils.AssertTheseDiagnostics(compilation, - + Dim expectedDiagnostics = ) +]]>.Value + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub diff --git a/src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs b/src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs index f568ce544efce..1f379a719d99c 100644 --- a/src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs +++ b/src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs @@ -1264,6 +1264,141 @@ public override void VisitPatternCaseClause(IPatternCaseClause operation) Visit(operation.GuardExpression, "Guard Expression"); } + public override void VisitQueryExpression(IQueryExpression operation) + { + LogString(nameof(IQueryExpression)); + LogCommonPropertiesAndNewLine(operation); + + Visit(operation.LastClauseOrContinuation, "LastClauseOrContinuation"); + } + + public override void VisitOrderingExpression(IOrderingExpression operation) + { + LogString(nameof(IOrderingExpression)); + LogString($" (Order kind: {operation.OrderKind})"); + LogCommonPropertiesAndNewLine(operation); + + Visit(operation.Expression, "Expression"); + } + + public override void VisitAggregationExpression(IAggregationExpression operation) + { + LogString(nameof(IAggregationExpression)); + var aggregationkind = operation.IsGroupAggregation ? "Group" : "Function"; + LogString($" (Aggregation Kind: {aggregationkind})"); + LogCommonPropertiesAndNewLine(operation); + + Visit(operation.Expression, "Expression"); + } + + public override void VisitQueryContinuation(IQueryContinuation operation) + { + LogString(nameof(IQueryContinuation)); + LogSymbol(operation.DeclaredSymbol, " (Declared symbol"); + LogString(")"); + LogCommonPropertiesAndNewLine(operation); + + Visit(operation.QueryBody, "Query Body"); + } + + private void VisitQueryClauseCommon(IQueryClause operation) + { + LogString($" (Clause kind: {operation.ClauseKind})"); + LogCommonPropertiesAndNewLine(operation); + + Visit(operation.ReducedExpression, "ReducedExpression"); + } + + public override void VisitFromQueryClause(IFromQueryClause operation) + { + LogString(nameof(IFromQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitSelectQueryClause(ISelectQueryClause operation) + { + LogString(nameof(ISelectQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitWhereQueryClause(IWhereQueryClause operation) + { + LogString(nameof(IWhereQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitLetQueryClause(ILetQueryClause operation) + { + LogString(nameof(ILetQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitOrderByQueryClause(IOrderByQueryClause operation) + { + LogString(nameof(IOrderByQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitGroupByQueryClause(IGroupByQueryClause operation) + { + LogString(nameof(IGroupByQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitGroupJoinQueryClause(IGroupJoinQueryClause operation) + { + LogString(nameof(IGroupJoinQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitJoinQueryClause(IJoinQueryClause operation) + { + LogString(nameof(IJoinQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitJoinIntoQueryClause(IJoinIntoQueryClause operation) + { + LogString(nameof(IJoinIntoQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitAggregateQueryClause(IAggregateQueryClause operation) + { + LogString(nameof(IAggregateQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitDistinctQueryClause(IDistinctQueryClause operation) + { + LogString(nameof(IDistinctQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitSkipQueryClause(ISkipQueryClause operation) + { + LogString(nameof(ISkipQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitSkipWhileQueryClause(ISkipWhileQueryClause operation) + { + LogString(nameof(ISkipWhileQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitTakeQueryClause(ITakeQueryClause operation) + { + LogString(nameof(ITakeQueryClause)); + VisitQueryClauseCommon(operation); + } + + public override void VisitTakeWhileQueryClause(ITakeWhileQueryClause operation) + { + LogString(nameof(ITakeWhileQueryClause)); + VisitQueryClauseCommon(operation); + } + #endregion } } diff --git a/src/Test/Utilities/Portable/Compilation/TestOperationWalker.cs b/src/Test/Utilities/Portable/Compilation/TestOperationWalker.cs index 9cfceaeedb903..b1c87bcf99096 100644 --- a/src/Test/Utilities/Portable/Compilation/TestOperationWalker.cs +++ b/src/Test/Utilities/Portable/Compilation/TestOperationWalker.cs @@ -598,5 +598,106 @@ public override void VisitPatternCaseClause(IPatternCaseClause operation) base.VisitPatternCaseClause(operation); } + + public override void VisitQueryExpression(IQueryExpression operation) + { + base.VisitQueryExpression(operation); + } + + public override void VisitOrderingExpression(IOrderingExpression operation) + { + var orderKind = operation.OrderKind; + + base.VisitOrderingExpression(operation); + } + + public override void VisitAggregationExpression(IAggregationExpression operation) + { + var isGroupAggregation = operation.IsGroupAggregation; + + base.VisitAggregationExpression(operation); + } + + public override void VisitQueryContinuation(IQueryContinuation operation) + { + var declaredSymbol = operation.DeclaredSymbol; + + base.VisitQueryContinuation(operation); + } + + public override void VisitFromQueryClause(IFromQueryClause operation) + { + base.VisitFromQueryClause(operation); + } + + public override void VisitSelectQueryClause(ISelectQueryClause operation) + { + base.VisitSelectQueryClause(operation); + } + + public override void VisitWhereQueryClause(IWhereQueryClause operation) + { + base.VisitWhereQueryClause(operation); + } + + public override void VisitLetQueryClause(ILetQueryClause operation) + { + base.VisitLetQueryClause(operation); + } + + public override void VisitOrderByQueryClause(IOrderByQueryClause operation) + { + base.VisitOrderByQueryClause(operation); + } + + public override void VisitGroupByQueryClause(IGroupByQueryClause operation) + { + base.VisitGroupByQueryClause(operation); + } + + public override void VisitGroupJoinQueryClause(IGroupJoinQueryClause operation) + { + base.VisitGroupJoinQueryClause(operation); + } + + public override void VisitJoinQueryClause(IJoinQueryClause operation) + { + base.VisitJoinQueryClause(operation); + } + + public override void VisitJoinIntoQueryClause(IJoinIntoQueryClause operation) + { + base.VisitJoinIntoQueryClause(operation); + } + + public override void VisitAggregateQueryClause(IAggregateQueryClause operation) + { + base.VisitAggregateQueryClause(operation); + } + + public override void VisitDistinctQueryClause(IDistinctQueryClause operation) + { + base.VisitDistinctQueryClause(operation); + } + + public override void VisitSkipQueryClause(ISkipQueryClause operation) + { + base.VisitSkipQueryClause(operation); + } + + public override void VisitSkipWhileQueryClause(ISkipWhileQueryClause operation) + { + base.VisitSkipWhileQueryClause(operation); + } + + public override void VisitTakeQueryClause(ITakeQueryClause operation) + { + base.VisitTakeQueryClause(operation); + } + + public override void VisitTakeWhileQueryClause(ITakeWhileQueryClause operation) + { + base.VisitTakeWhileQueryClause(operation); + } } } From 8569cec926fb564ffc020793879f841878acf8fa Mon Sep 17 00:00:00 2001 From: Manish Vasani Date: Wed, 16 Aug 2017 11:28:03 -0700 Subject: [PATCH 2/8] Fix unit tests and add a workaround for https://github.com/dotnet/roslyn/issues/21554 --- .../Test/Semantic/Semantics/QueryTests.cs | 191 ++++-- .../Operations/VisualBasicOperationFactory.vb | 9 +- .../Semantic/Semantics/QueryExpressions.vb | 608 ++++++++++++------ 3 files changed, 527 insertions(+), 281 deletions(-) diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs index 9f94330f50f34..26e7eb6f13244 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.IO; @@ -56,13 +56,15 @@ public static void Main(string[] args) Instance Receiver: null Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') @@ -123,13 +125,15 @@ public static void Main(string[] args) Instance Receiver: null Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') @@ -139,7 +143,8 @@ public static void Main(string[] args) InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'q') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'q') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'q') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'q') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'q') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'q') @@ -192,13 +197,15 @@ public static void Main(string[] args) Instance Receiver: null Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i+1') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i+1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i+1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i+1') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i+1') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i+1') @@ -253,13 +260,15 @@ public static void Main(string[] args) Instance Receiver: null Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'i % 2') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i % 2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i % 2') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i % 2') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i % 2') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i % 2') @@ -335,14 +344,16 @@ public static void Main(string[] args) Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') InConversion: null OutConversion: null InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') @@ -400,14 +411,16 @@ public static void Main(string[] args) Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') InConversion: null OutConversion: null InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'i < 5') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i < 5') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i < 5') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i < 5') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i < 5') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i < 5') @@ -471,18 +484,21 @@ join x2 in c2 on x1 equals x2/10 Instance Receiver: null Arguments(5): IArgument (ArgumentKind.Explicit, Matching Parameter: outer) (OperationKind.Argument) (Syntax: 'from x1 in c1') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in c1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x1 in c1') ReducedExpression: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'c2') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 'x1') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1') @@ -490,7 +506,8 @@ join x2 in c2 on x1 equals x2/10 InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 'x2/10') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x2/10') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x2/10') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x2/10') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x2/10') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x2/10') @@ -500,7 +517,8 @@ join x2 in c2 on x1 equals x2/10 InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x1+x2') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1+x2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1+x2') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1+x2') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1+x2') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1+x2') @@ -567,13 +585,15 @@ public static void Main(string[] args) Instance Receiver: null Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'i/10') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i/10') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i/10') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i/10') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i/10') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i/10') @@ -585,7 +605,8 @@ public static void Main(string[] args) InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'i%10') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i%10') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i%10') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i%10') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i%10') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i%10') @@ -651,18 +672,21 @@ join x2 in c2 on x1 equals x2 / 10 into g Instance Receiver: null Arguments(5): IArgument (ArgumentKind.Explicit, Matching Parameter: outer) (OperationKind.Argument) (Syntax: 'from x1 in c1') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in c1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x1 in c1') ReducedExpression: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'c2') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 'x1') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1') @@ -670,7 +694,8 @@ join x2 in c2 on x1 equals x2 / 10 into g InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 'x2 / 10') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x2 / 10') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x2 / 10') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x2 / 10') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x2 / 10') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x2 / 10') @@ -681,13 +706,15 @@ join x2 in c2 on x1 equals x2 / 10 into g OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'into g') IJoinIntoQueryClause (Clause kind: JoinIntoClause) (OperationKind.QueryClause) (Syntax: 'into g') - ReducedExpression: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func, System.String>) (Syntax: 'x1 + "":"" + g.ToString()') + ReducedExpression: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func, System.String>) (Syntax: 'x1 + "":"" + g.ToString()') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1 + "":"" + g.ToString()') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1 + "":"" + g.ToString()') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1 + "":"" + g.ToString()') ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.StringConcatenate) (OperationKind.BinaryOperatorExpression, Type: System.String) (Syntax: 'x1 + "":"" + g.ToString()') Left: IBinaryOperatorExpression (BinaryOperationKind.StringConcatenate) (OperationKind.BinaryOperatorExpression, Type: System.String) (Syntax: 'x1 + "":""') - Left: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'x1') + Left: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'x1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 'x1') Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "":"") (Syntax: '"":""') Right: IInvocationExpression (virtual System.String System.Object.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'g.ToString()') @@ -744,23 +771,27 @@ public static void Main(string[] args) Instance Receiver: null Arguments(3): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from x in c1') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in c1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in c1') ReducedExpression: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'from y in c2') IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from y in c2') - ReducedExpression: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') + ReducedExpression: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c2') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c2') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c2') - ReturnedValue: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x + y') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x + y') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x + y') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y') @@ -855,14 +886,16 @@ public static void Main(string[] args) Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c1') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') InConversion: null OutConversion: null InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x * 10') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x * 10') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x * 10') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x * 10') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x * 10') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x * 10') @@ -884,7 +917,8 @@ public static void Main(string[] args) InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'g + x*100') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'g + x*100') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'g + x*100') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'g + x*100') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'g + x*100') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'g + x*100') @@ -908,7 +942,8 @@ public static void Main(string[] args) InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + z') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z>, System.Int32>) (Syntax: 'x + z') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z>, System.Int32>) (Syntax: 'x + z') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + z') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + z') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + z') @@ -1006,14 +1041,16 @@ from int z in c3 Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c1') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') InConversion: null OutConversion: null InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c2') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c2') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c2') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c2') @@ -1021,14 +1058,16 @@ from int z in c3 Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c2') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') InConversion: null OutConversion: null InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'from int y in c2') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'from int y in c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'from int y in c2') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from int y in c2') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from int y in c2') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from int y in c2') @@ -1048,7 +1087,8 @@ from int z in c3 InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c3') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, System.Collections.Generic.IEnumerable>) (Syntax: 'c3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.Collections.Generic.IEnumerable>) (Syntax: 'c3') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c3') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c3') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c3') @@ -1056,14 +1096,16 @@ from int z in c3 Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c3') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c3') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c3 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c3') InConversion: null OutConversion: null InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'from int z in c3') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, System.Int32, <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'from int z in c3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.Int32, <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'from int z in c3') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from int z in c3') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from int z in c3') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from int z in c3') @@ -1083,7 +1125,8 @@ from int z in c3 InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + y + z') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z>, <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>) (Syntax: 'x + y + z') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z>, <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>) (Syntax: 'x + y + z') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y + z') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y + z') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y + z') @@ -1107,7 +1150,8 @@ from int z in c3 InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: '(x + y / 10 ... / 100) < 6') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Boolean>) (Syntax: '(x + y / 10 ... / 100) < 6') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Boolean>) (Syntax: '(x + y / 10 ... / 100) < 6') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '(x + y / 10 ... / 100) < 6') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '(x + y / 10 ... / 100) < 6') IReturnStatement (OperationKind.ReturnStatement) (Syntax: '(x + y / 10 ... / 100) < 6') @@ -1127,7 +1171,8 @@ from int z in c3 InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'g') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Int32>) (Syntax: 'g') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Int32>) (Syntax: 'g') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'g') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'g') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'g') @@ -1322,14 +1367,16 @@ from int z in c3 Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c1') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') InConversion: null OutConversion: null InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c2') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c2') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c2') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c2') @@ -1337,14 +1384,16 @@ from int z in c3 Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c2') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') InConversion: null OutConversion: null InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'from int y in c2') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'from int y in c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'from int y in c2') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from int y in c2') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from int y in c2') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from int y in c2') @@ -1365,7 +1414,8 @@ from int z in c3 OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'from int z in c3') IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int z in c3') - ReducedExpression: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, System.Collections.Generic.IEnumerable>) (Syntax: 'c3') + ReducedExpression: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.Collections.Generic.IEnumerable>) (Syntax: 'c3') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c3') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c3') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c3') @@ -1373,14 +1423,16 @@ from int z in c3 Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c3') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c3') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c3 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c3') InConversion: null OutConversion: null InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x + y + z') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func<, System.Int32, System.Int32>) (Syntax: 'x + y + z') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.Int32, System.Int32>) (Syntax: 'x + y + z') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y + z') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y + z') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y + z') @@ -1631,7 +1683,8 @@ static void Main(string[] args) Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'new int[] { 1 }') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'new int[] { 1 }') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'new int[] { 1 }') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32[]) (Syntax: 'new int[] { 1 }') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'new int[] { 1 }') @@ -1840,7 +1893,8 @@ join b in Enumerable.Range(1, 13) on 4 * a equals b InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: '4 * a') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: '4 * a') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: '4 * a') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '4 * a') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '4 * a') IReturnStatement (OperationKind.ReturnStatement) (Syntax: '4 * a') @@ -1850,7 +1904,8 @@ join b in Enumerable.Range(1, 13) on 4 * a equals b InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 'b') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'b') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'b') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'b') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'b') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'b') @@ -1858,7 +1913,8 @@ join b in Enumerable.Range(1, 13) on 4 * a equals b InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'a') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'a') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'a') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'a') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'a') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'a') @@ -2553,7 +2609,8 @@ static void Main() Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'string.Empty') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable, IsInvalid) (Syntax: 'string.Empty') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable, IsInvalid) (Syntax: 'string.Empty') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IFieldReferenceExpression: System.String System.String.Empty (Static) (OperationKind.FieldReferenceExpression, Type: System.String, IsInvalid) (Syntax: 'string.Empty') Instance Receiver: null InConversion: null @@ -3401,7 +3458,8 @@ where x.ToString() == y.ToString() ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: Q) (Syntax: 'q') Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: f1) (OperationKind.Argument) (Syntax: 'q') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'q') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'q') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'q') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'q') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'q') @@ -3409,7 +3467,8 @@ where x.ToString() == y.ToString() InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: f2) (OperationKind.Argument) (Syntax: 'from y in q') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func, y>>) (Syntax: 'from y in q') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func, y>>) (Syntax: 'from y in q') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from y in q') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from y in q') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from y in q') @@ -3428,7 +3487,8 @@ where x.ToString() == y.ToString() OutConversion: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: f1) (OperationKind.Argument) (Syntax: 'x.ToString( ... .ToString()') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func< y>, System.Boolean>) (Syntax: 'x.ToString( ... .ToString()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< y>, System.Boolean>) (Syntax: 'x.ToString( ... .ToString()') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x.ToString( ... .ToString()') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x.ToString( ... .ToString()') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x.ToString( ... .ToString()') @@ -3914,7 +3974,8 @@ static void Main() Instance Receiver: null Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from a in new[] { 1 }') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from a in new[] { 1 }') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from a in new[] { 1 }') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from a in new[] { 1 }') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32[]) (Syntax: 'new[] { 1 }') Dimension Sizes(1): @@ -3925,11 +3986,13 @@ Element Values(1): InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument, IsInvalid) (Syntax: '(Func)(a => 1)') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func>, IsInvalid) (Syntax: '(Func)(a => 1)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>, IsInvalid) (Syntax: '(Func)(a => 1)') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: '(Func)(a => 1)') IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: '(Func)(a => 1)') IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: '(Func)(a => 1)') - ReturnedValue: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Func, IsInvalid) (Syntax: '(Func)(a => 1)') + ReturnedValue: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func, IsInvalid) (Syntax: '(Func)(a => 1)') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'a => 1') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '1') IReturnStatement (OperationKind.ReturnStatement) (Syntax: '1') diff --git a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb index ed33eec08b077..58fa4260a7162 100644 --- a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb +++ b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb @@ -26,11 +26,12 @@ Namespace Microsoft.CodeAnalysis.Semantics ' this should be removed once this issue is fixed ' https://github.com/dotnet/roslyn/issues/21186 - If TypeOf boundNode Is BoundValuePlaceholderBase Then - ' since same place holder bound node appears in multiple places in the tree + ' https://github.com/dotnet/roslyn/issues/21554 + If TypeOf boundNode Is BoundValuePlaceholderBase OrElse + (TypeOf boundNode Is BoundParameter AndAlso boundNode.WasCompilerGenerated) Then + ' since same bound node appears in multiple places in the tree ' we can't use bound node to operation map. - ' for now, we will just create new operation and return clone but we need to figure out - ' what we want to do with place holder node such as just returning nothing + ' for now, we will just create new operation and return cloned Return _semanticModel.CloneOperation(CreateInternal(boundNode)) End If diff --git a/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb b/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb index 9ecc54a381837..30bff89932679 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb @@ -62,8 +62,9 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = .Value - Dim expectedOperationTree = s') +Dim expectedOperationTree = s') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... here 10 > s') LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where 10 > s') ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where 10 > s') @@ -166,7 +169,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') Left: IOperation: (OperationKind.None) (Syntax: 's') Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') @@ -174,7 +178,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') Left: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') Right: IOperation: (OperationKind.None) (Syntax: 's') @@ -255,8 +260,9 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = s') +Dim expectedOperationTree = s') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... here 10 > s') LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where 10 > s') ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where 10 > s') @@ -266,7 +272,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') Left: IOperation: (OperationKind.None) (Syntax: 's') Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') @@ -274,7 +281,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') Left: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') Right: IOperation: (OperationKind.None) (Syntax: 's') @@ -315,7 +323,8 @@ Module Module1 End Module]]>.Value Dim expectedOperationTree = 0') +IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q Where s > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble, IsInvalid) (Syntax: 'From s In q Where s > 0') LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Where s > 0') ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble, IsInvalid) (Syntax: 'Where s > 0') @@ -366,7 +375,8 @@ Module Module1 End Module]]>.Value Dim expectedOperationTree = 0') +IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q Where s > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble, IsInvalid) (Syntax: 'From s In q Where s > 0') LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Where s > 0') ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble, IsInvalid) (Syntax: 'Where s > 0') @@ -420,7 +430,8 @@ Module Module1 End Module]]>.Value Dim expectedOperationTree = 0') +IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q Where s > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble, IsInvalid) (Syntax: 'From s In q Where s > 0') LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Where s > 0') ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble, IsInvalid) (Syntax: 'Where s > 0') @@ -586,13 +597,15 @@ IQueryExpression (OperationKind.QueryExpression, Type: C) (Syntax: 'From z In N Initializer: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: f) (OperationKind.Argument) (Syntax: 'z') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'z') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'z') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 'z') InConversion: null OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: f) (OperationKind.Argument) (Syntax: 'z.ToString()') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.String)) (Syntax: 'z.ToString()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.String)) (Syntax: 'z.ToString()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression (virtual Function System.Int32.ToString() As System.String) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'z.ToString()') Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'z') Arguments(0) @@ -600,7 +613,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: C) (Syntax: 'From z In N OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: f) (OperationKind.Argument) (Syntax: 'z.ToUpper()') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.String, System.String)) (Syntax: 'z.ToUpper()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.String, System.String)) (Syntax: 'z.ToUpper()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( Function System.String.ToUpper() As System.String) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'z.ToUpper()') Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'z') Arguments(0) @@ -2135,7 +2149,8 @@ Module Module1 End Module]]>.Value Dim expectedOperationTree = 0') +IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'From s In q ... ere Two > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... ere Two > 0') LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where Two > 0') ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where Two > 0') @@ -2157,13 +2172,15 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's') InConversion: null OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') Left: IOperation: (OperationKind.None) (Syntax: 's') Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') @@ -2171,7 +2188,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Num1()') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'Num1()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'Num1()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression (Function Module1.Num1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Num1()') Instance Receiver: null Arguments(0) @@ -2179,7 +2197,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Num1 = -10') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Num1 = -10') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Num1 = -10') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'Num1 = -10') Left: IOperation: (OperationKind.None) (Syntax: 'Num1') Right: IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, Constant: -10) (Syntax: '-10') @@ -2188,7 +2207,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Module1.Num2()') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'Module1.Num2()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'Module1.Num2()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression (Function Module1.Num2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Module1.Num2()') Instance Receiver: null Arguments(0) @@ -2196,7 +2216,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Num2 = -10 + Num1()') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Num2 = -10 + Num1()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Num2 = -10 + Num1()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'Num2 = -10 + Num1()') Left: IOperation: (OperationKind.None) (Syntax: 'Num2') Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '-10 + Num1()') @@ -2209,7 +2230,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'ind!Two') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'ind!Two') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'ind!Two') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IPropertyReferenceExpression: Property Module1.Index.Item(x As System.String) As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'ind!Two') Instance Receiver: ILocalReferenceExpression: ind (OperationKind.LocalReferenceExpression, Type: Module1.Index) (Syntax: 'ind') Arguments(1): @@ -2221,7 +2243,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Two > 0') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Two > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Two > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'Two > 0') Left: IOperation: (OperationKind.None) (Syntax: 'Two') Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') @@ -2972,8 +2995,9 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = 1') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'q1') Variables: Local_1: q1 As System.Object - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q ... While s > 1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q ... While s > 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'From s In q ... While s > 1') LastClauseOrContinuation: ITakeWhileQueryClause (Clause kind: TakeWhileClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Take While s > 1') ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Take While s > 1') @@ -3619,7 +3644,8 @@ IBlockStatement (5 statements, 3 locals) (OperationKind.BlockStatement, IsInvali IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Dim q2 As O ... While s > 1') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'q2') Variables: Local_1: q2 As System.Object - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q ... While s > 1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q ... While s > 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'From s In q ... While s > 1') LastClauseOrContinuation: ISkipWhileQueryClause (Clause kind: SkipWhileClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Skip While s > 1') ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Skip While s > 1') @@ -3743,7 +3769,8 @@ Module Module1 End Module]]>.Value Dim expectedOperationTree = 0') +IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'From s In q ... While s > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... While s > 0') LastClauseOrContinuation: ISkipWhileQueryClause (Clause kind: SkipWhileClause) (OperationKind.QueryClause) (Syntax: 'Skip While s > 0') ReducedExpression: IInvocationExpression ( Function QueryAble.SkipWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Skip While s > 0') @@ -3751,7 +3778,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') Left: IOperation: (OperationKind.None) (Syntax: 's') Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') @@ -3800,8 +3828,9 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = 0') +Dim expectedOperationTree = 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... While s > 0') LastClauseOrContinuation: ITakeWhileQueryClause (Clause kind: TakeWhileClause) (OperationKind.QueryClause) (Syntax: 'Take While s > 0') ReducedExpression: IInvocationExpression ( Function QueryAble.TakeWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Take While s > 0') @@ -3809,7 +3838,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') Left: IOperation: (OperationKind.None) (Syntax: 's') Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') @@ -3858,8 +3888,9 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = 0') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') Left: IOperation: (OperationKind.None) (Syntax: 's') Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') @@ -3881,7 +3913,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') Left: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') Right: IOperation: (OperationKind.None) (Syntax: 's') @@ -3889,7 +3922,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') Left: IOperation: (OperationKind.None) (Syntax: 's') Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') @@ -3897,7 +3931,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's') InConversion: null OutConversion: null @@ -3930,8 +3965,9 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = .Value - Dim expectedOperationTree = .Value - Dim expectedOperationTree = .Value - Dim expectedOperationTree = .Value Dim expectedOperationTree = .Value - Dim expectedOperationTree = .Value - Dim expectedOperationTree = .Value - Dim expectedOperationTree = .Value - Dim expectedOperationTree = )) (Syntax: 'From s1 In ... s2 = s1 + 1') LastClauseOrContinuation: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let s2 = s1 + 1') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of )(selector As System.Func(Of System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's2 = s1 + 1') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') Dimension Sizes(1): @@ -5425,7 +5488,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's2 = s1 + 1') Initializers(2): IOperation: (OperationKind.None) (Syntax: 's1') @@ -5458,13 +5522,15 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = )) (Syntax: 'From s1 In ... 3 = s2 + s1') LastClauseOrContinuation: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Select(Of )(selector As System.Func(Of , )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's3 = s2 + s1') Instance Receiver: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let s2 = s1 ... 3 = s2 + s1') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of )(selector As System.Func(Of System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's2 = s1 + 1') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') Dimension Sizes(1): @@ -5474,7 +5540,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's2 = s1 + 1') Initializers(2): IOperation: (OperationKind.None) (Syntax: 's1') @@ -5485,7 +5552,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's2 + s1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , )) (Syntax: 's2 + s1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , )) (Syntax: 's2 + s1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's3 = s2 + s1') Initializers(3): IOperation: (OperationKind.None) (Syntax: 's1') @@ -5519,8 +5587,9 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = )) (Syntax: 'From s1 In ... 2 + s3 + s4') LastClauseOrContinuation: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>, Key s4 As System.Int32>).Select(Of )(selector As System.Func(Of , Key s3 As System.Int32>, Key s4 As System.Int32>, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's5 = s1 + s2 + s3 + s4') Instance Receiver: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let s4 = s1 ... 2 + s3 + s4') @@ -5528,7 +5597,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Select(Of , Key s3 As System.Int32>)(selector As System.Func(Of , , Key s3 As System.Int32>)) As System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>)) (Syntax: 's3 = s2 + s1') Instance Receiver: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let s2 = s1 ... 3 = s2 + s1') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of )(selector As System.Func(Of System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's2 = s1 + 1') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {3}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {3}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3}') Dimension Sizes(1): @@ -5538,7 +5608,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's2 = s1 + 1') Initializers(2): IOperation: (OperationKind.None) (Syntax: 's1') @@ -5549,7 +5620,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's2 + s1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , , Key s3 As System.Int32>)) (Syntax: 's2 + s1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , , Key s3 As System.Int32>)) (Syntax: 's2 + s1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's3 = s2 + s1') Initializers(2): IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's3 = s2 + s1') @@ -5560,7 +5632,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + s2 + s3') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key s3 As System.Int32>, , Key s3 As System.Int32>, Key s4 As System.Int32>)) (Syntax: 's1 + s2 + s3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key s3 As System.Int32>, , Key s3 As System.Int32>, Key s4 As System.Int32>)) (Syntax: 's1 + s2 + s3') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's4 = s1 + s2 + s3') Initializers(2): IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's4 = s1 + s2 + s3') @@ -5573,7 +5646,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + s2 + s3 + s4') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key s3 As System.Int32>, Key s4 As System.Int32>, )) (Syntax: 's1 + s2 + s3 + s4') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key s3 As System.Int32>, Key s4 As System.Int32>, )) (Syntax: 's1 + s2 + s3 + s4') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's5 = s1 + s2 + s3 + s4') Initializers(5): IOperation: (OperationKind.None) (Syntax: 's1') @@ -7050,12 +7124,14 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = )) (Syntax: 'From s1 In ... 1 Equals s2') LastClauseOrContinuation: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join s2 In ... 1 Equals s2') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s2 In ... 1 Equals s2') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 3}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... er() {1, 3}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 3}') Dimension Sizes(1): @@ -7066,7 +7142,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') Arguments(4): IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') @@ -7077,17 +7154,20 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's1') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's2') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s2 In ... 1 Equals s2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join s2 In ... 1 Equals s2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join s2 In ... 1 Equals s2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s2 In ... 1 Equals s2') Initializers(2): IOperation: (OperationKind.None) (Syntax: 's1') @@ -7119,14 +7199,16 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = )) (Syntax: 'From s1 In ... uals s2 * 2') LastClauseOrContinuation: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join s3 In ... uals s2 * 2') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s3 In ... uals s2 * 2') Instance Receiver: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join s2 In ... 1 Equals s2') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s2 In ... 1 Equals s2') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') Dimension Sizes(1): @@ -7136,7 +7218,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') Arguments(4): IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') @@ -7147,19 +7230,22 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1 + 1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') Left: IOperation: (OperationKind.None) (Syntax: 's1') Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's2') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s2 In ... 1 Equals s2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join s2 In ... 1 Equals s2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join s2 In ... 1 Equals s2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s2 In ... 1 Equals s2') Initializers(2): IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') @@ -7168,7 +7254,8 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE OutConversion: null Arguments(4): IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's3 In New I ... er() {4, 5}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New I ... er() {4, 5}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New I ... er() {4, 5}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {4, 5}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {4, 5}') @@ -7179,19 +7266,22 @@ IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionE InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's3') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's3') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 * 2') Left: IOperation: (OperationKind.None) (Syntax: 's2') Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2 * 2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2 * 2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2 * 2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's3') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s3 In ... uals s2 * 2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join s3 In ... uals s2 * 2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join s3 In ... uals s2 * 2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s3 In ... uals s2 * 2') Initializers(3): IOperation: (OperationKind.None) (Syntax: 's1') @@ -8109,8 +8199,9 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = .Value - Dim expectedOperationTree = )) (Syntax: 'From s1 In ... Into Group') LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group By s1 Into Group') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By s1 Into Group') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... 3, 4, 2, 3}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') Dimension Sizes(1): @@ -8321,12 +8413,14 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') Arguments(2): IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's1') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By s1 Into Group') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By s1 Into Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By s1 Into Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By s1 Into Group') Initializers(2): IOperation: (OperationKind.None) (Syntax: 's1') @@ -8360,11 +8454,12 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = )) (Syntax: 'From s1 In ... nto Count()') LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group By s1 Into Count()') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By s1 Into Count()') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... 3, 4, 2, 3}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') Dimension Sizes(1): @@ -8379,12 +8474,14 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') Arguments(2): IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's1') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By s1 Into Count()') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By s1 Into Count()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By s1 Into Count()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By s1 Into Count()') Initializers(2): IOperation: (OperationKind.None) (Syntax: 's1') @@ -8423,11 +8520,12 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = )) (Syntax: 'From s1 In ... Into Group') LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group s1 By ... Into Group') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), elementSelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1 By ... Into Group') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... 3, 4, 2, 3}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') Dimension Sizes(1): @@ -8442,17 +8540,20 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') Arguments(3): IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's1') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: elementSelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's1') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group s1 By ... Into Group') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group s1 By ... Into Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group s1 By ... Into Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group s1 By ... Into Group') Initializers(2): IOperation: (OperationKind.None) (Syntax: 's1') @@ -8493,7 +8594,8 @@ End Module]]>.Value IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable(Of ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'From s1 In ... (), Max(s1)') LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group s1, s ... (), Max(s1)') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of , , ), Key c As System.Int32, Key Max As System.Int32>)(keySelector As System.Func(Of System.Int32, ), elementSelector As System.Func(Of System.Int32, ), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of ), ), Key c As System.Int32, Key Max As System.Int32>)) As System.Collections.Generic.IEnumerable(Of ), Key c As System.Int32, Key Max As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'Group s1, s ... (), Max(s1)') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... 3, 4, 2, 3}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') Dimension Sizes(1): @@ -8508,7 +8610,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') Arguments(3): IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1 Mod 2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 Mod 2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 Mod 2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group s1, s ... (), Max(s1)') Initializers(2): IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 Mod 2') @@ -8520,16 +8623,19 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: elementSelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group s1, s ... (), Max(s1)') Initializers(2): IOperation: (OperationKind.None) (Syntax: 's1') - IConversionExpression (ConversionKind.Basic, Explicit) (OperationKind.ConversionExpression, Type: System.String) (Syntax: 'CStr(s1)') + IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String) (Syntax: 'CStr(s1)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's1') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group s1, s ... (), Max(s1)') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of ), ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'Group s1, s ... (), Max(s1)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of ), ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'Group s1, s ... (), Max(s1)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ), Key c As System.Int32, Key Max As System.Int32>) (Syntax: 'Group s1, s ... (), Max(s1)') Initializers(5): IOperation: (OperationKind.None) (Syntax: 's1') @@ -8545,7 +8651,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi Instance Receiver: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1, s ... (), Max(s1)') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's1') InConversion: null OutConversion: null @@ -8580,7 +8687,7 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = )) (Syntax: 'From s1 In ... y Equals s1') LastClauseOrContinuation: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join s1 In ... y Equals s1') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s1 In ... y Equals s1') @@ -8588,7 +8695,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By ke ... Into Group') Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select s1 + 1') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of System.Int32)(selector As System.Func(Of System.Int32, System.Int32)) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Select s1 + 1') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 2}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 2}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... er() {1, 2}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 2}') Dimension Sizes(1): @@ -8599,7 +8707,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') Left: IOperation: (OperationKind.None) (Syntax: 's1') Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') @@ -8607,12 +8716,14 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(2): IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: '1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: '1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By ke ... Into Group') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By ke ... Into Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By ke ... Into Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By ke ... Into Group') Initializers(2): IOperation: (OperationKind.None) (Syntax: 'key') @@ -8622,7 +8733,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(4): IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's1 In New I ... er() {1, 2}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 2}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 2}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 2}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 2}') @@ -8633,17 +8745,20 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 'key') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 'key') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 'key') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 'key') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's1') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s1 In ... y Equals s1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join s1 In ... y Equals s1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join s1 In ... y Equals s1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s1 In ... y Equals s1') Initializers(3): IOperation: (OperationKind.None) (Syntax: 'key') @@ -8846,8 +8961,9 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = .Value - Dim expectedOperationTree = )) (Syntax: 'From s1 In ... Into Group') LastClauseOrContinuation: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause) (Syntax: 'Group Join ... Into Group') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupJoin(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... Into Group') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 3}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... er() {1, 3}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 3}') Dimension Sizes(1): @@ -9235,7 +9352,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') Arguments(4): IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') @@ -9246,17 +9364,20 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's1') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's2') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... Into Group') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... Into Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... Into Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... Into Group') Initializers(2): IOperation: (OperationKind.None) (Syntax: 's1') @@ -9297,13 +9418,14 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = )) (Syntax: 'From s1 In ... gr2 = Group') LastClauseOrContinuation: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause) (Syntax: 'Group Join ... gr2 = Group') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).GroupJoin(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... gr2 = Group') Instance Receiver: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause) (Syntax: 'Group Join ... gr1 = Group') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupJoin(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... gr1 = Group') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') Dimension Sizes(1): @@ -9313,7 +9435,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') Arguments(4): IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') @@ -9324,19 +9447,22 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1 + 1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') Left: IOperation: (OperationKind.None) (Syntax: 's1') Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's2') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... gr1 = Group') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... gr1 = Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... gr1 = Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... gr1 = Group') Initializers(2): IOperation: (OperationKind.None) (Syntax: 's1') @@ -9346,7 +9472,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(4): IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's3 In New I ... er() {4, 5}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New I ... er() {4, 5}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New I ... er() {4, 5}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {4, 5}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {4, 5}') @@ -9357,7 +9484,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's3') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's3') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '(s1 + 1) * 2') Left: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Int32) (Syntax: '(s1 + 1)') Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') @@ -9367,12 +9495,14 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: '(s1 + 1) * 2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: '(s1 + 1) * 2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: '(s1 + 1) * 2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's3') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... gr2 = Group') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... gr2 = Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... gr2 = Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... gr2 = Group') Initializers(3): IOperation: (OperationKind.None) (Syntax: 's1') @@ -9420,7 +9550,7 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = )>)) (Syntax: 'From s1 In ... s3 = Group') LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... s3 = Group') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of )>).Select(Of )>)(selector As System.Func(Of )>, )>)) As System.Collections.Generic.IEnumerable(Of )>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )>)) (Syntax: 'From s1 In ... s3 = Group') @@ -9428,7 +9558,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ReducedExpression: IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable(Of )>)) (Syntax: 'From s1 In ... s3 = Group') LastClauseOrContinuation: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause) (Syntax: 'Group Join ... s3 = Group') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupJoin(Of , System.Int32, )>)(inner As System.Collections.Generic.IEnumerable(Of ), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of , System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ), )>)) As System.Collections.Generic.IEnumerable(Of )>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )>)) (Syntax: 'Group Join ... s3 = Group') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') Dimension Sizes(1): @@ -9442,7 +9573,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join ... 2 Equals s4') Instance Receiver: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join ... 2 Equals s3') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join ... 2 Equals s3') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New Integer() {1}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') @@ -9451,7 +9583,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') Arguments(4): IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's3 In New Integer() {1}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New Integer() {1}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') @@ -9461,17 +9594,20 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's2') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's3') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's3') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's3') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join ... 2 Equals s3') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join ... 2 Equals s3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join ... 2 Equals s3') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join ... 2 Equals s3') Initializers(2): IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2') @@ -9480,7 +9616,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(4): IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's4 In New Integer() {1}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's4 In New Integer() {1}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's4 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') @@ -9490,17 +9627,20 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's2') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's4') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's4') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's4') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's4') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join ... 2 Equals s4') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join ... 2 Equals s4') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join ... 2 Equals s4') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join ... 2 Equals s4') Initializers(3): IOperation: (OperationKind.None) (Syntax: 's2') @@ -9511,17 +9651,20 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's1') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 's2') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... s3 = Group') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ), )>)) (Syntax: 'Group Join ... s3 = Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ), )>)) (Syntax: 'Group Join ... s3 = Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: )>) (Syntax: 'Group Join ... s3 = Group') Initializers(2): IOperation: (OperationKind.None) (Syntax: 's1') @@ -9531,7 +9674,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'From s1 In ... s3 = Group') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of )>, )>)) (Syntax: 'From s1 In ... s3 = Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of )>, )>)) (Syntax: 'From s1 In ... s3 = Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: )>) (Syntax: 's1') InConversion: null OutConversion: null @@ -10426,8 +10570,9 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = ), IsInvalid) (Syntax: 'From s1 In ... Into Group') LastClauseOrContinuation: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Group Join ... Into Group') ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble(Of ), IsInvalid) (Syntax: 'Group Join ... Into Group') @@ -10594,7 +10739,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Int32) (Syntax: 'A LastClauseOrContinuation: IAggregateQueryClause (Clause kind: AggregateClause) (OperationKind.QueryClause) (Syntax: 'Aggregate y ... nto Count()') ReducedExpression: IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Count()') Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New In ... er() {3, 4}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New In ... er() {3, 4}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3, 4}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {3, 4}') @@ -10628,23 +10774,27 @@ Module Module1 End Module]]>.Value Dim expectedOperationTree = ) (Syntax: 'Aggregate y ... Sum(y \ 2)') LastClauseOrContinuation: IAggregateQueryClause (Clause kind: AggregateClause) (OperationKind.QueryClause) (Syntax: 'Aggregate y ... Sum(y \ 2)') ReducedExpression: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Aggregate y ... Sum(y \ 2)') Initializers(2): IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Count()') Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IPlaceholderExpression (OperationKind.PlaceholderExpression, Type: System.Int32()) (Syntax: 'Aggregate y ... Sum(y \ 2)') Arguments(0) IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Sum(y \ 2)') Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Sum(selector As System.Func(Of System.Int32, System.Int32)) As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Sum(y \ 2)') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IPlaceholderExpression (OperationKind.PlaceholderExpression, Type: System.Int32()) (Syntax: 'Aggregate y ... Sum(y \ 2)') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'y \ 2') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'y \ 2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'y \ 2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'y \ 2') Left: IOperation: (OperationKind.None) (Syntax: 'y') Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') @@ -10674,7 +10824,7 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = y') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Where(predicate As System.Func(Of , System.Boolean)) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where x > y') Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'y In New In ... er() {1, 3}') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New In ... er() {3, 4}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New In ... er() {3, 4}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3, 4}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {3, 4}') @@ -10692,8 +10843,10 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Int32) (Syntax: 'A ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') Arguments(2): IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {1, 3}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {1, 3}') - Operand: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New In ... er() {1, 3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {1, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New In ... er() {1, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 3}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 3}') @@ -10704,7 +10857,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Int32) (Syntax: 'A InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Sum(x + y)') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Sum(x + y)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Sum(x + y)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'y In New In ... er() {1, 3}') Initializers(2): IOperation: (OperationKind.None) (Syntax: 'x') @@ -10713,7 +10867,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Int32) (Syntax: 'A OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'x > y') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'x > y') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'x > y') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'x > y') Left: IOperation: (OperationKind.None) (Syntax: 'x') Right: IOperation: (OperationKind.None) (Syntax: 'y') @@ -10721,7 +10876,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Int32) (Syntax: 'A OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + y') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 'x + y') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 'x + y') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') Left: IOperation: (OperationKind.None) (Syntax: 'x') Right: IOperation: (OperationKind.None) (Syntax: 'y') @@ -10753,14 +10909,15 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = )) (Syntax: 'Aggregate x ... Where(True)') LastClauseOrContinuation: IAggregateQueryClause (Clause kind: AggregateClause) (OperationKind.QueryClause) (Syntax: 'Aggregate x ... Where(True)') ReducedExpression: IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Where(predicate As System.Func(Of , System.Boolean)) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'z In New Integer() {3}') Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'y In New Integer() {2}') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New Integer() {1}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') @@ -10769,8 +10926,10 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') Arguments(2): IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {2}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {2}') - Operand: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New Integer() {2}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {2}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New Integer() {2}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {2}') @@ -10780,7 +10939,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'y In New Integer() {2}') Initializers(2): IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') @@ -10789,8 +10949,10 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(2): IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {3}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {3}') - Operand: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'z In New Integer() {3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'z In New Integer() {3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {3}') @@ -10800,7 +10962,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'z In New Integer() {3}') Initializers(3): IOperation: (OperationKind.None) (Syntax: 'x') @@ -10810,7 +10973,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'True') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'True') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') InConversion: null OutConversion: null @@ -10847,13 +11011,14 @@ Module Module1 End Sub End Module]]>.Value - Dim expectedOperationTree = ))) (Syntax: 'From x In N ... Where(True)') LastClauseOrContinuation: IAggregateQueryClause (Clause kind: AggregateClause) (OperationKind.QueryClause) (Syntax: 'Aggregate x ... Where(True)') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of System.Collections.Generic.IEnumerable(Of ))(selector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ))) As System.Collections.Generic.IEnumerable(Of System.Collections.Generic.IEnumerable(Of ))) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Collections.Generic.IEnumerable(Of ))) (Syntax: 'Aggregate x ... Where(True)') Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select x + 1') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of System.Int32)(selector As System.Func(Of System.Int32, System.Int32)) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Select x + 1') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New In ... er() {3, 4}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New In ... er() {3, 4}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From x In N ... er() {3, 4}') ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3, 4}') Dimension Sizes(1): @@ -10864,7 +11029,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + 1') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'x + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'x + 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + 1') Left: IOperation: (OperationKind.None) (Syntax: 'x') Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') @@ -10872,7 +11038,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'New Integer() {1}') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ))) (Syntax: 'New Integer() {1}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ))) (Syntax: 'New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Where(predicate As System.Func(Of , System.Boolean)) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') Instance Receiver: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let w = x + y + z') @@ -10889,7 +11056,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).TakeWhile(predicate As System.Func(Of , Key z As System.Int32>, System.Boolean)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Take While True') Instance Receiver: IDistinctQueryClause (Clause kind: DistinctClause) (OperationKind.QueryClause) (Syntax: 'Distinct') ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Distinct() As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Distinct') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Order By x') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Order By x') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOrderByQueryClause (Clause kind: OrderByClause) (OperationKind.QueryClause) (Syntax: 'Order By x') ReducedExpression: IOrderingExpression (Order kind: Ascending) (OperationKind.OrderingExpression, Type: System.Linq.IOrderedEnumerable(Of , Key z As System.Int32>)) (Syntax: 'x') Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).OrderBy(Of System.Int32)(keySelector As System.Func(Of , Key z As System.Int32>, System.Int32)) As System.Linq.IOrderedEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Linq.IOrderedEnumerable(Of , Key z As System.Int32>)) (Syntax: 'x') @@ -10897,7 +11065,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Where(predicate As System.Func(Of , Key z As System.Int32>, System.Boolean)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Where True') Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).SelectMany(Of System.Int32, , Key z As System.Int32>)(collectionSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of , System.Int32, , Key z As System.Int32>)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'z In New Integer() {3}') Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'y In New Integer() {2}') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New Integer() {1}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') @@ -10906,8 +11075,10 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') Arguments(2): IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {2}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {2}') - Operand: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New Integer() {2}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {2}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New Integer() {2}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {2}') @@ -10917,7 +11088,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'y In New Integer() {2}') Initializers(2): IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') @@ -10926,8 +11098,10 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(2): IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {3}') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {3}') - Operand: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'z In New Integer() {3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'z In New Integer() {3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {3}') @@ -10937,7 +11111,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, , Key z As System.Int32>)) (Syntax: 'Aggregate x ... Where(True)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, , Key z As System.Int32>)) (Syntax: 'Aggregate x ... Where(True)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , Key z As System.Int32>) (Syntax: 'z In New Integer() {3}') Initializers(2): IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'z In New Integer() {3}') @@ -10946,26 +11121,30 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'True') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'True') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') InConversion: null OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'x') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Int32)) (Syntax: 'x') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Int32)) (Syntax: 'x') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 'x') InConversion: null OutConversion: null Arguments(0) Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'True') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'True') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') InConversion: null OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'False') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'False') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'False') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: False) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: False) (Syntax: 'False') InConversion: null OutConversion: null @@ -10981,7 +11160,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, )) (Syntax: 'x') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, )) (Syntax: 'x') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Select x, y, z') Initializers(3): IOperation: (OperationKind.None) (Syntax: 'x') @@ -10991,7 +11171,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + y + z') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , )) (Syntax: 'x + y + z') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , )) (Syntax: 'x + y + z') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'w = x + y + z') Initializers(4): IOperation: (OperationKind.None) (Syntax: 'x') @@ -11006,7 +11187,8 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'True') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'True') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') InConversion: null OutConversion: null From 78edd7c7e3a381d8676ded68c83ef8c6bc30f571 Mon Sep 17 00:00:00 2001 From: Manish Vasani Date: Tue, 5 Sep 2017 09:15:45 -0700 Subject: [PATCH 3/8] Address feedback from the design meeting and only expose the top level ITranslatedQueryExpression IOperation for v1. We longer expose any special IOperation nodes for query clauses/operators, but just the underlying query plan. For v2, we hope to enhance the APIs to expose a richer query API. Another design decision was to rewrite VB query lambdas into regular lambda, so we have parity between C# and VB operation trees. This change refactors the VB query lambda local rewriting code to be consumed from the VB operation factory for the same. The rewriter introduces a large number of DAGs, and we handle them in the operation factory rewriter by cloning the duplicate bound nodes in the lowered tree. --- .../Operations/CSharpOperationFactory.cs | 128 +- .../IOperationTests_IForLoopStatement.cs | 228 +- ...tionTests_IParameterReferenceExpression.cs | 44 +- .../Test/Semantic/Semantics/QueryTests.cs | 1954 +++++----- .../Generated/Operations.xml.Generated.cs | 862 +---- ...ssion.cs => ITranslatedQueryExpression.cs} | 12 +- .../Portable/Operations/OperationCloner.cs | 94 +- .../Core/Portable/Operations/OperationKind.cs | 14 +- .../Portable/Operations/OperationVisitor.cs | 184 +- .../Queries/IAggregateQueryClause.cs | 15 - .../Queries/IAggregationExpression.cs | 24 - .../Queries/IDistinctQueryClause.cs | 15 - .../Operations/Queries/IFromQueryClause.cs | 17 - .../Operations/Queries/IGroupByQueryClause.cs | 15 - .../Queries/IGroupJoinQueryClause.cs | 15 - .../Queries/IJoinIntoQueryClause.cs | 15 - .../Operations/Queries/IJoinQueryClause.cs | 15 - .../Operations/Queries/ILetQueryClause.cs | 15 - .../Operations/Queries/IOrderByQueryClause.cs | 15 - .../Operations/Queries/IQueryClause.cs | 24 - .../Operations/Queries/IQueryContinuation.cs | 24 - .../Operations/Queries/IQueryExpression.cs | 21 - .../Operations/Queries/ISelectQueryClause.cs | 17 - .../Operations/Queries/ISkipQueryClause.cs | 15 - .../Queries/ISkipWhileQueryClause.cs | 15 - .../Operations/Queries/ITakeQueryClause.cs | 15 - .../Queries/ITakeWhileQueryClause.cs | 15 - .../Operations/Queries/IWhereQueryClause.cs | 15 - .../Portable/Operations/Queries/OrderKind.cs | 26 - .../Operations/Queries/QueryClauseKind.cs | 44 - .../Core/Portable/PublicAPI.Unshipped.txt | 106 +- .../LocalRewriter/LocalRewriter_Query.vb | 146 +- .../Operations/VisualBasicOperationFactory.vb | 152 +- ...sicOperationFactory_QueryLambdaRewriter.vb | 93 + ...tionTests_IParameterReferenceExpression.vb | 148 +- .../Semantic/Semantics/QueryExpressions.vb | 3422 +++++++++-------- .../Compilation/OperationTreeVerifier.cs | 131 +- .../Compilation/TestOperationWalker.cs | 100 +- 38 files changed, 3321 insertions(+), 4889 deletions(-) rename src/Compilers/Core/Portable/Operations/{Queries/IOrderExpression.cs => ITranslatedQueryExpression.cs} (52%) delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IAggregateQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IAggregationExpression.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IDistinctQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IFromQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IGroupByQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IGroupJoinQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IJoinIntoQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IJoinQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/ILetQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IOrderByQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IQueryContinuation.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IQueryExpression.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/ISelectQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/ISkipQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/ISkipWhileQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/ITakeQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/ITakeWhileQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/IWhereQueryClause.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/OrderKind.cs delete mode 100644 src/Compilers/Core/Portable/Operations/Queries/QueryClauseKind.cs create mode 100644 src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb diff --git a/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs b/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs index c0729387f7fe3..c1aff64d0ee1b 100644 --- a/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs +++ b/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs @@ -254,7 +254,7 @@ private IOperation CreateInternal(BoundNode boundNode) case BoundKind.IsPatternExpression: return CreateBoundIsPatternExpressionOperation((BoundIsPatternExpression)boundNode); case BoundKind.QueryClause: - return CreateBoundQueryClauseOrExpressionOperation((BoundQueryClause)boundNode); + return CreateBoundQueryClauseOperation((BoundQueryClause)boundNode); default: var constantValue = ConvertToOptional((boundNode as BoundExpression)?.ConstantValue); return Operation.CreateOperationNone(_semanticModel, boundNode.Syntax, constantValue, getChildren: () => GetIOperationChildren(boundNode)); @@ -1389,135 +1389,19 @@ private IIsPatternExpression CreateBoundIsPatternExpressionOperation(BoundIsPatt return new LazyIsPatternExpression(expression, pattern, _semanticModel, syntax, type, constantValue); } - private IOperation CreateBoundQueryClauseOrExpressionOperation(BoundQueryClause boundQueryClause) + private IOperation CreateBoundQueryClauseOperation(BoundQueryClause boundQueryClause) { - var queryClauseKindOpt = GetQueryClauseKind(boundQueryClause); - return queryClauseKindOpt.HasValue ? - CreateBoundQueryClauseOperation(boundQueryClause, queryClauseKindOpt.Value) : - CreateBoundQueryOrContinuationOrOrderExpressionOperation(boundQueryClause); - } - - private IQueryClause CreateBoundQueryClauseOperation(BoundQueryClause boundQueryClause, QueryClauseKind queryClauseKind) - { - Lazy underlyingExpression = new Lazy(() => Create(boundQueryClause.Value)); - SyntaxNode syntax = boundQueryClause.Syntax; - ITypeSymbol type = boundQueryClause.Type; - Optional constantValue = ConvertToOptional(boundQueryClause.ConstantValue); - - switch(queryClauseKind) - { - case QueryClauseKind.FromClause: - return new LazyFromQueryClause(underlyingExpression, _semanticModel, syntax, type, constantValue); - - case QueryClauseKind.SelectClause: - return new LazySelectQueryClause(underlyingExpression, _semanticModel, syntax, type, constantValue); - - case QueryClauseKind.WhereClause: - return new LazyWhereQueryClause(underlyingExpression, _semanticModel, syntax, type, constantValue); - - case QueryClauseKind.LetClause: - return new LazyLetQueryClause(underlyingExpression, _semanticModel, syntax, type, constantValue); - - case QueryClauseKind.OrderByClause: - return new LazyOrderByQueryClause(underlyingExpression, _semanticModel, syntax, type, constantValue); - - case QueryClauseKind.GroupByClause: - return new LazyGroupByQueryClause(underlyingExpression, _semanticModel, syntax, type, constantValue); - - case QueryClauseKind.JoinClause: - return new LazyJoinQueryClause(underlyingExpression, _semanticModel, syntax, type, constantValue); - - case QueryClauseKind.JoinIntoClause: - return new LazyJoinIntoQueryClause(underlyingExpression, _semanticModel, syntax, type, constantValue); - - default: - throw ExceptionUtilities.Unreachable; - } - } - - private IOperation CreateBoundQueryOrContinuationOrOrderExpressionOperation(BoundQueryClause boundQueryClause) - { - switch(boundQueryClause.Syntax.Kind()) + if (boundQueryClause.Syntax.Kind() != SyntaxKind.QueryExpression) { - case SyntaxKind.QueryExpression: - return CreateBoundQueryExpressionOperation(boundQueryClause); - - case SyntaxKind.QueryContinuation: - return CreateBoundQueryContinuationOperation(boundQueryClause); - - case SyntaxKind.AscendingOrdering: - return CreateBoundOrderingExpressionOperation(boundQueryClause, OrderKind.Ascending); - - case SyntaxKind.DescendingOrdering: - return CreateBoundOrderingExpressionOperation(boundQueryClause, OrderKind.Descending); - - case SyntaxKind.QueryBody: - return boundQueryClause.Value != null ? Create((BoundQueryClause)boundQueryClause.Value) : null; - - default: - throw ExceptionUtilities.Unreachable; + // Currently we have no IOperation APIs for different query clauses or continuation. + return Create(boundQueryClause.Value); } - } - - private IQueryExpression CreateBoundQueryExpressionOperation(BoundQueryClause boundQueryClause) - { - Lazy lastClauseOrContinuation = new Lazy(() => Create(boundQueryClause.Value)); - SyntaxNode syntax = boundQueryClause.Syntax; - ITypeSymbol type = boundQueryClause.Type; - Optional constantValue = ConvertToOptional(boundQueryClause.ConstantValue); - return new LazyQueryExpression(lastClauseOrContinuation, _semanticModel, syntax, type, constantValue); - } - private IQueryContinuation CreateBoundQueryContinuationOperation(BoundQueryClause boundQueryClause) - { - Lazy queryBody = new Lazy(() => Create(boundQueryClause.Value)); - IRangeVariableSymbol definedSymbol = boundQueryClause.DefinedSymbol; - SyntaxNode syntax = boundQueryClause.Syntax; - ITypeSymbol type = boundQueryClause.Type; - Optional constantValue = ConvertToOptional(boundQueryClause.ConstantValue); - return new LazyQueryContinuation(queryBody, definedSymbol, _semanticModel, syntax, type, constantValue); - } - - private IOrderingExpression CreateBoundOrderingExpressionOperation(BoundQueryClause boundQueryClause, OrderKind orderKind) - { Lazy expression = new Lazy(() => Create(boundQueryClause.Value)); SyntaxNode syntax = boundQueryClause.Syntax; ITypeSymbol type = boundQueryClause.Type; Optional constantValue = ConvertToOptional(boundQueryClause.ConstantValue); - return new LazyOrderingExpression(expression, orderKind, _semanticModel, syntax, type, constantValue); - } - - private QueryClauseKind? GetQueryClauseKind(BoundQueryClause boundQueryClause) - { - switch(boundQueryClause.Syntax.Kind()) - { - case SyntaxKind.FromClause: - return QueryClauseKind.FromClause; - - case SyntaxKind.SelectClause: - return QueryClauseKind.SelectClause; - - case SyntaxKind.WhereClause: - return QueryClauseKind.WhereClause; - - case SyntaxKind.LetClause: - return QueryClauseKind.LetClause; - - case SyntaxKind.OrderByClause: - return QueryClauseKind.OrderByClause; - - case SyntaxKind.GroupClause: - return QueryClauseKind.GroupByClause; - - case SyntaxKind.JoinClause: - return QueryClauseKind.JoinClause; - - case SyntaxKind.JoinIntoClause: - return QueryClauseKind.JoinIntoClause; - - default: - return null; - } + return new LazyTranslatedQueryExpression(expression, _semanticModel, syntax, type, constantValue); } } } diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.cs index a93cfcccff922..e5e813a25d21b 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Test.Utilities; @@ -1364,72 +1364,67 @@ select z into w IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'str = from ... select w') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'str = from ... select w') Variables: Local_1: System.Collections.Generic.IEnumerable str - Initializer: IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in "" ... select w') - LastClauseOrContinuation: IQueryContinuation (Declared symbol: ? w) (OperationKind.QueryContinuation) (Syntax: 'into w ... select w') - Query Body: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select w') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select w') + Initializer: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in "" ... select w') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select w') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'select z') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select<, System.String>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.String> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select z') Instance Receiver: null Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'select z') - ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select z') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select<, System.String>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.String> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select z') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') - ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'let z = x.ToString()') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'let z = x.ToString()') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from x in ""123""') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in ""123""') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in ""123""') - ReducedExpression: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""123"") (Syntax: '""123""') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x.ToString()') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x.ToString()') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x.ToString()') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x.ToString()') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x.ToString()') - ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Char x, System.String z)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'let z = x.ToString()') - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') - IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Char) (Syntax: 'let z = x.ToString()') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'x.ToString()') - IInvocationExpression (virtual System.String System.Char.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'x.ToString()') - Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'x') - Arguments(0) - InConversion: null - OutConversion: null - Initializer: null - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'z') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.String>) (Syntax: 'z') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'z') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'z') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'z') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'z') - InConversion: null - OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') + IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'let z = x.ToString()') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from x in ""123""') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in ""123""') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""123"") (Syntax: '""123""') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x.ToString()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x.ToString()') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x.ToString()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x.ToString()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x.ToString()') + ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Char x, System.String z)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'let z = x.ToString()') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Char) (Syntax: 'let z = x.ToString()') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'x.ToString()') + IInvocationExpression (virtual System.String System.Char.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'x.ToString()') + Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'x') + Arguments(0) + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'w') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'w') + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'z') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.String>) (Syntax: 'z') Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'w') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'w') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'w') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'w') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'z') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'z') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'z') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'z') InConversion: null OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'w') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'w') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'w') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'w') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'w') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'w') + InConversion: null + OutConversion: null AtLoopBottom(0) Body: IBlockStatement (2 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IForEachLoopStatement (Iteration variable: System.String item) (LoopKind.ForEach) (OperationKind.LoopStatement) (Syntax: 'foreach (va ... }') @@ -1496,72 +1491,67 @@ select z into w AtLoopBottom(0) Body: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'return from ... select w;') - ReturnedValue: IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in "" ... select w') - LastClauseOrContinuation: IQueryContinuation (Declared symbol: ? w) (OperationKind.QueryContinuation) (Syntax: 'into w ... select w') - Query Body: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select w') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select w') + ReturnedValue: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in "" ... select w') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select w') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'select z') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select<, System.String>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.String> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select z') Instance Receiver: null Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'select z') - ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select z') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select<, System.String>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.String> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select z') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') - ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'let z = x.ToString()') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'let z = x.ToString()') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from x in ""123""') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in ""123""') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in ""123""') - ReducedExpression: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""123"") (Syntax: '""123""') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x.ToString()') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x.ToString()') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x.ToString()') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x.ToString()') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x.ToString()') - ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Char x, System.String z)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'let z = x.ToString()') - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') - IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Char) (Syntax: 'let z = x.ToString()') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'x.ToString()') - IInvocationExpression (virtual System.String System.Char.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'x.ToString()') - Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'x') - Arguments(0) - InConversion: null - OutConversion: null - Initializer: null - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'z') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.String>) (Syntax: 'z') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'z') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'z') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'z') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'z') - InConversion: null - OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') + IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'let z = x.ToString()') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from x in ""123""') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in ""123""') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""123"") (Syntax: '""123""') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x.ToString()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x.ToString()') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x.ToString()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x.ToString()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x.ToString()') + ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Char x, System.String z)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'let z = x.ToString()') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'let z = x.ToString()') + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Char) (Syntax: 'let z = x.ToString()') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'x.ToString()') + IInvocationExpression (virtual System.String System.Char.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'x.ToString()') + Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'x') + Arguments(0) + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'w') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'w') + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'z') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.String>) (Syntax: 'z') Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'w') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'w') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'w') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'w') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'z') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'z') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'z') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'z') InConversion: null OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'w') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'w') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'w') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'w') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'w') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'w') + InConversion: null + OutConversion: null "; VerifyOperationTreeForTest(source, expectedOperationTree); } diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.cs index 95f974133ab69..80afc35134191 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; @@ -143,28 +143,26 @@ public void M(List customers) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from cust i ... t cust.Name') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select cust.Name') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select cust.Name') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from cust in customers') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from cust in customers') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from cust in customers') - ReducedExpression: IParameterReferenceExpression: customers (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'customers') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'cust.Name') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'cust.Name') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'cust.Name') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'cust.Name') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'cust.Name') - ReturnedValue: IPropertyReferenceExpression: System.String Customer.Name { get; set; } (OperationKind.PropertyReferenceExpression, Type: System.String) (Syntax: 'cust.Name') - Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'cust') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from cust i ... t cust.Name') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select cust.Name') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from cust in customers') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from cust in customers') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IParameterReferenceExpression: customers (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'customers') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'cust.Name') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'cust.Name') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'cust.Name') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'cust.Name') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'cust.Name') + ReturnedValue: IPropertyReferenceExpression: System.String Customer.Name { get; set; } (OperationKind.PropertyReferenceExpression, Type: System.String) (Syntax: 'cust.Name') + Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'cust') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs index 26e7eb6f13244..93b3808b7c8b4 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs @@ -33,6 +33,7 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[1, 2, 3, 4, 5, 6, 7]"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void FromClause_IOperation() { @@ -50,27 +51,25 @@ public static void Main(string[] args) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c select i') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') - ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'i') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c select i') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'i') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -96,6 +95,7 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[1, 2, 3, 4, 5, 6, 7]"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void QueryContinuation_IOperation() { @@ -113,44 +113,40 @@ public static void Main(string[] args) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c ... q select q') - LastClauseOrContinuation: IQueryContinuation (Declared symbol: ? q) (OperationKind.QueryContinuation) (Syntax: 'into q select q') - Query Body: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select q') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select q') +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c ... q select q') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select q') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'select i') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i') Instance Receiver: null Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'select i') - ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') - ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'i') - InConversion: null - OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'q') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'q') + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'q') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'q') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'q') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'q') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'i') InConversion: null OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'q') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'q') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'q') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'q') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'q') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'q') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -174,6 +170,7 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[2, 3, 4, 5, 6, 7, 8]"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void SelectClause_IOperation() { @@ -191,29 +188,27 @@ public static void Main(string[] args) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c select i+1') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i+1') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i+1') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') - ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i+1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i+1') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i+1') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i+1') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i+1') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i+1') - Left: IOperation: (OperationKind.None) (Syntax: 'i') - Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c select i+1') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i+1') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i+1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i+1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i+1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i+1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i+1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i+1') + Left: IOperation: (OperationKind.None) (Syntax: 'i') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -237,6 +232,7 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[1:[1, 3, 5, 7], 0:[2, 4, 6]]"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void GroupByClause_IOperation() { @@ -254,29 +250,27 @@ public static void Main(string[] args) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable>) (Syntax: 'from i in c ... i by i % 2') - LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'group i by i % 2') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable> System.Linq.Enumerable.GroupBy(this System.Collections.Generic.IEnumerable source, System.Func keySelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable>) (Syntax: 'group i by i % 2') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') - ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'i % 2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i % 2') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i % 2') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i % 2') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i % 2') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i % 2') - Left: IOperation: (OperationKind.None) (Syntax: 'i') - Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable>) (Syntax: 'from i in c ... i by i % 2') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable> System.Linq.Enumerable.GroupBy(this System.Collections.Generic.IEnumerable source, System.Func keySelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable>) (Syntax: 'group i by i % 2') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'i % 2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i % 2') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i % 2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i % 2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i % 2') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i % 2') + Left: IOperation: (OperationKind.None) (Syntax: 'i') + Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -316,6 +310,7 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[1, 2, 3, 4, 5, 6, 7]"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void CastInFromClause_IOperation() { @@ -333,33 +328,31 @@ public static void Main(string[] args) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i in c select i') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int i in c') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int i in c') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i in c') - Instance Receiver: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'i') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i in c select i') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int i in c') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i in c') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'i') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -382,6 +375,7 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[1, 2, 3, 4]"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void WhereClause_IOperation() { @@ -399,36 +393,33 @@ public static void Main(string[] args) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i ... 5 select i') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i') - ReducedExpression: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'where i < 5') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Where(this System.Collections.Generic.IEnumerable source, System.Func predicate)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'where i < 5') +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i ... 5 select i') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Where(this System.Collections.Generic.IEnumerable source, System.Func predicate)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'where i < 5') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int i in c') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i in c') Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int i in c') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int i in c') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i in c') - Instance Receiver: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'i < 5') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i < 5') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i < 5') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i < 5') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i < 5') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerLessThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'i < 5') - Left: IOperation: (OperationKind.None) (Syntax: 'i') - Right: ILiteralExpression (Text: 5) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 5) (Syntax: '5') + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') InConversion: null OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'i < 5') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i < 5') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i < 5') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i < 5') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i < 5') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerLessThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'i < 5') + Left: IOperation: (OperationKind.None) (Syntax: 'i') + Right: ILiteralExpression (Text: 5) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 5) (Syntax: '5') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -455,6 +446,7 @@ join x2 in c2 on x1 equals x2/10 CompileAndVerify(csSource, expectedOutput: "[11, 33, 44, 55, 77]"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void FromJoinSelect_IOperation() { @@ -477,56 +469,53 @@ join x2 in c2 on x1 equals x2/10 // BoundRangeVariable still doesn't have an IOperation API: https://github.com/dotnet/roslyn/issues/21238 string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in ... elect x1+x2') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x1+x2') - ReducedExpression: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'join x2 in ... quals x2/10') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Join(this System.Collections.Generic.IEnumerable outer, System.Collections.Generic.IEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'join x2 in ... quals x2/10') - Instance Receiver: null - Arguments(5): - IArgument (ArgumentKind.Explicit, Matching Parameter: outer) (OperationKind.Argument) (Syntax: 'from x1 in c1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in c1') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x1 in c1') - ReducedExpression: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'c2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 'x1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'x1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 'x2/10') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x2/10') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x2/10') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x2/10') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x2/10') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x2/10') - Left: IOperation: (OperationKind.None) (Syntax: 'x2') - Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x1+x2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1+x2') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1+x2') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1+x2') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1+x2') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x1+x2') - Left: IOperation: (OperationKind.None) (Syntax: 'x1') - Right: IOperation: (OperationKind.None) (Syntax: 'x2') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in ... elect x1+x2') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Join(this System.Collections.Generic.IEnumerable outer, System.Collections.Generic.IEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'join x2 in ... quals x2/10') + Instance Receiver: null + Arguments(5): + IArgument (ArgumentKind.Explicit, Matching Parameter: outer) (OperationKind.Argument) (Syntax: 'from x1 in c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in c1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 'x1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'x1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 'x2/10') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x2/10') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x2/10') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x2/10') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x2/10') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x2/10') + Left: IOperation: (OperationKind.None) (Syntax: 'x2') + Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x1+x2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1+x2') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1+x2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1+x2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1+x2') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x1+x2') + Left: IOperation: (OperationKind.None) (Syntax: 'x1') + Right: IOperation: (OperationKind.None) (Syntax: 'x2') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -553,6 +542,7 @@ from i in c CompileAndVerify(csSource, expectedOutput: "[84, 72, 64, 51, 55, 46, 39, 27, 27, 27, 28]"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void OrderByClause_IOperation() { @@ -572,49 +562,44 @@ public static void Main(string[] args) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'from i in c ... select i') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i') - ReducedExpression: IOrderByQueryClause (Clause kind: OrderByClause) (OperationKind.QueryClause) (Syntax: 'orderby i/1 ... nding, i%10') - ReducedExpression: IOrderingExpression (Order kind: Ascending) (OperationKind.OrderingExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'i%10') - Expression: IInvocationExpression (System.Linq.IOrderedEnumerable System.Linq.Enumerable.ThenBy(this System.Linq.IOrderedEnumerable source, System.Func keySelector)) (OperationKind.InvocationExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'i%10') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'i/10 descending') - IOrderingExpression (Order kind: Descending) (OperationKind.OrderingExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'i/10 descending') - Expression: IInvocationExpression (System.Linq.IOrderedEnumerable System.Linq.Enumerable.OrderByDescending(this System.Collections.Generic.IEnumerable source, System.Func keySelector)) (OperationKind.InvocationExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'i/10 descending') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from i in c') - ReducedExpression: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'i/10') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i/10') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i/10') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i/10') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i/10') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i/10') - Left: IOperation: (OperationKind.None) (Syntax: 'i') - Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'i%10') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i%10') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i%10') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i%10') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i%10') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i%10') - Left: IOperation: (OperationKind.None) (Syntax: 'i') - Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'from i in c ... select i') + Expression: IInvocationExpression (System.Linq.IOrderedEnumerable System.Linq.Enumerable.ThenBy(this System.Linq.IOrderedEnumerable source, System.Func keySelector)) (OperationKind.InvocationExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'i%10') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'i/10 descending') + IInvocationExpression (System.Linq.IOrderedEnumerable System.Linq.Enumerable.OrderByDescending(this System.Collections.Generic.IEnumerable source, System.Func keySelector)) (OperationKind.InvocationExpression, Type: System.Linq.IOrderedEnumerable) (Syntax: 'i/10 descending') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'i/10') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i/10') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i/10') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i/10') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i/10') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i/10') + Left: IOperation: (OperationKind.None) (Syntax: 'i') + Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'i%10') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i%10') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i%10') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i%10') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i%10') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i%10') + Left: IOperation: (OperationKind.None) (Syntax: 'i') + Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -642,6 +627,7 @@ join x2 in c2 on x1 equals x2 / 10 into g CompileAndVerify(csSource, expectedOutput: "[1:[12], 2:[], 3:[34], 4:[42], 5:[51, 52], 7:[75]]"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void GroupJoinClause_IOperation() { @@ -665,63 +651,59 @@ join x2 in c2 on x1 equals x2 / 10 into g // BoundRangeVariable still doesn't have an IOperation API: https://github.com/dotnet/roslyn/issues/21238 string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in ... .ToString()') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x1 + ... .ToString()') - ReducedExpression: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'join x2 in ... / 10 into g') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.GroupJoin(this System.Collections.Generic.IEnumerable outer, System.Collections.Generic.IEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func, System.String> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'join x2 in ... / 10 into g') - Instance Receiver: null - Arguments(5): - IArgument (ArgumentKind.Explicit, Matching Parameter: outer) (OperationKind.Argument) (Syntax: 'from x1 in c1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in c1') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x1 in c1') - ReducedExpression: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'c2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 'x1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'x1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 'x2 / 10') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x2 / 10') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x2 / 10') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x2 / 10') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x2 / 10') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x2 / 10') - Left: IOperation: (OperationKind.None) (Syntax: 'x2') - Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'into g') - IJoinIntoQueryClause (Clause kind: JoinIntoClause) (OperationKind.QueryClause) (Syntax: 'into g') - ReducedExpression: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func, System.String>) (Syntax: 'x1 + "":"" + g.ToString()') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1 + "":"" + g.ToString()') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1 + "":"" + g.ToString()') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1 + "":"" + g.ToString()') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.StringConcatenate) (OperationKind.BinaryOperatorExpression, Type: System.String) (Syntax: 'x1 + "":"" + g.ToString()') - Left: IBinaryOperatorExpression (BinaryOperationKind.StringConcatenate) (OperationKind.BinaryOperatorExpression, Type: System.String) (Syntax: 'x1 + "":""') - Left: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'x1') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 'x1') - Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "":"") (Syntax: '"":""') - Right: IInvocationExpression (virtual System.String System.Object.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'g.ToString()') - Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'g') - Arguments(0) - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in ... .ToString()') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.GroupJoin(this System.Collections.Generic.IEnumerable outer, System.Collections.Generic.IEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func, System.String> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'join x2 in ... / 10 into g') + Instance Receiver: null + Arguments(5): + IArgument (ArgumentKind.Explicit, Matching Parameter: outer) (OperationKind.Argument) (Syntax: 'from x1 in c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x1 in c1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 'x1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'x1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 'x2 / 10') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x2 / 10') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x2 / 10') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x2 / 10') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x2 / 10') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x2 / 10') + Left: IOperation: (OperationKind.None) (Syntax: 'x2') + Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x1 + "":"" + g.ToString()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func, System.String>) (Syntax: 'x1 + "":"" + g.ToString()') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x1 + "":"" + g.ToString()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x1 + "":"" + g.ToString()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x1 + "":"" + g.ToString()') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.StringConcatenate) (OperationKind.BinaryOperatorExpression, Type: System.String) (Syntax: 'x1 + "":"" + g.ToString()') + Left: IBinaryOperatorExpression (BinaryOperationKind.StringConcatenate) (OperationKind.BinaryOperatorExpression, Type: System.String) (Syntax: 'x1 + "":""') + Left: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'x1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IOperation: (OperationKind.None) (Syntax: 'x1') + Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "":"") (Syntax: '"":""') + Right: IInvocationExpression (virtual System.String System.Object.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'g.ToString()') + Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'g') + Arguments(0) + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -746,6 +728,7 @@ public static void Main(string[] args) CompileAndVerify(csSource, expectedOutput: "[11, 21, 31, 12, 22, 32, 13, 23, 33]"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void SelectMany_IOperation() { @@ -764,42 +747,38 @@ public static void Main(string[] args) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in c ... elect x + y') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x + y') - ReducedExpression: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from y in c2') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.SelectMany(this System.Collections.Generic.IEnumerable source, System.Func> collectionSelector, System.Func resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from y in c2') - Instance Receiver: null - Arguments(3): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from x in c1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in c1') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in c1') - ReducedExpression: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'from y in c2') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from y in c2') - ReducedExpression: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in c ... elect x + y') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.SelectMany(this System.Collections.Generic.IEnumerable source, System.Func> collectionSelector, System.Func resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from y in c2') + Instance Receiver: null + Arguments(3): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from x in c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from x in c1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c2') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c2') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c2') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c2') - ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x + y') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x + y') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') - Left: IOperation: (OperationKind.None) (Syntax: 'x') - Right: IOperation: (OperationKind.None) (Syntax: 'y') - InConversion: null - OutConversion: null + Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x + y') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'x + y') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IOperation: (OperationKind.None) (Syntax: 'y') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -845,6 +824,7 @@ from int x in c1 CompileAndVerify(csSource, expectedOutput: "[111, 222, 333]"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void LetClause_IOperation() { @@ -865,93 +845,89 @@ public static void Main(string[] args) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x ... elect x + z') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x + z') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select< <>h__TransparentIdentifier0, System.Int32 z>, System.Int32>(this System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>> source, System.Func< <>h__TransparentIdentifier0, System.Int32 z>, System.Int32> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select x + z') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let z = g + x*100') - ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'let z = g + x*100') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>> System.Linq.Enumerable.Select<, <>h__TransparentIdentifier0, System.Int32 z>>(this System.Collections.Generic.IEnumerable<> source, System.Func<, <>h__TransparentIdentifier0, System.Int32 z>> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'let z = g + x*100') +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x ... elect x + z') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select< <>h__TransparentIdentifier0, System.Int32 z>, System.Int32>(this System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>> source, System.Func< <>h__TransparentIdentifier0, System.Int32 z>, System.Int32> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select x + z') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let z = g + x*100') + IInvocationExpression (System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>> System.Linq.Enumerable.Select<, <>h__TransparentIdentifier0, System.Int32 z>>(this System.Collections.Generic.IEnumerable<> source, System.Func<, <>h__TransparentIdentifier0, System.Int32 z>> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'let z = g + x*100') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let g = x * 10') + IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'let g = x * 10') Instance Receiver: null Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let g = x * 10') - ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'let g = x * 10') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'let g = x * 10') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int x in c1') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int x in c1') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x in c1') - Instance Receiver: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x * 10') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x * 10') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x * 10') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x * 10') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x * 10') - ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Int32 x, System.Int32 g)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'let g = x * 10') - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'let g = x * 10') - IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'let g = x * 10') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: g) (OperationKind.Argument) (Syntax: 'x * 10') - IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x * 10') - Left: IOperation: (OperationKind.None) (Syntax: 'x') - Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') - InConversion: null - OutConversion: null - Initializer: null - InConversion: null - OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int x in c1') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x in c1') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') + InConversion: null + OutConversion: null InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'g + x*100') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'g + x*100') + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x * 10') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'x * 10') Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'g + x*100') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'g + x*100') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'g + x*100') - ReturnedValue: IObjectCreationExpression (Constructor: <>h__TransparentIdentifier0, System.Int32 z>..ctor( <>h__TransparentIdentifier0, System.Int32 z)) (OperationKind.ObjectCreationExpression, Type: <>h__TransparentIdentifier0, System.Int32 z>) (Syntax: 'let z = g + x*100') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x * 10') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x * 10') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x * 10') + ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Int32 x, System.Int32 g)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'let g = x * 10') Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: <>h__TransparentIdentifier0) (OperationKind.Argument) (Syntax: 'let z = g + x*100') - IParameterReferenceExpression: <>h__TransparentIdentifier0 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'let z = g + x*100') + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'let g = x * 10') + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'let g = x * 10') InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'g + x*100') - IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'g + x*100') - Left: IOperation: (OperationKind.None) (Syntax: 'g') - Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x*100') - Left: IOperation: (OperationKind.None) (Syntax: 'x') - Right: ILiteralExpression (Text: 100) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 100) (Syntax: '100') + IArgument (ArgumentKind.Explicit, Matching Parameter: g) (OperationKind.Argument) (Syntax: 'x * 10') + IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x * 10') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') InConversion: null OutConversion: null Initializer: null InConversion: null OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + z') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z>, System.Int32>) (Syntax: 'x + z') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + z') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + z') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + z') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + z') - Left: IOperation: (OperationKind.None) (Syntax: 'x') - Right: IOperation: (OperationKind.None) (Syntax: 'z') - InConversion: null - OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'g + x*100') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'g + x*100') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'g + x*100') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'g + x*100') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'g + x*100') + ReturnedValue: IObjectCreationExpression (Constructor: <>h__TransparentIdentifier0, System.Int32 z>..ctor( <>h__TransparentIdentifier0, System.Int32 z)) (OperationKind.ObjectCreationExpression, Type: <>h__TransparentIdentifier0, System.Int32 z>) (Syntax: 'let z = g + x*100') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: <>h__TransparentIdentifier0) (OperationKind.Argument) (Syntax: 'let z = g + x*100') + IParameterReferenceExpression: <>h__TransparentIdentifier0 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'let z = g + x*100') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'g + x*100') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'g + x*100') + Left: IOperation: (OperationKind.None) (Syntax: 'g') + Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x*100') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: ILiteralExpression (Text: 100) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 100) (Syntax: '100') + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + z') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z>, System.Int32>) (Syntax: 'x + z') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + z') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + z') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + z') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + z') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IOperation: (OperationKind.None) (Syntax: 'z') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -984,6 +960,7 @@ from int z in c3 CompileAndVerify(csSource, expectedOutput: "[111, 211, 311, 121, 221, 131, 112, 212, 122, 113]"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void TransparentIdentifiers_FromLet_IOperation() { @@ -1010,175 +987,169 @@ from int z in c3 } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x ... select g') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select g') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Int32>(this System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> source, System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Int32> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select g') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'where (x + ... / 100) < 6') - IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'where (x + ... / 100) < 6') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> System.Linq.Enumerable.Where< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>(this System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> source, System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Boolean> predicate)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>) (Syntax: 'where (x + ... / 100) < 6') +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x ... select g') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Int32>(this System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> source, System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Int32> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select g') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'where (x + ... / 100) < 6') + IInvocationExpression (System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> System.Linq.Enumerable.Where< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>(this System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> source, System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Boolean> predicate)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>) (Syntax: 'where (x + ... / 100) < 6') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let g = x + y + z') + IInvocationExpression (System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> System.Linq.Enumerable.Select< <>h__TransparentIdentifier0, System.Int32 z>, <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>(this System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>> source, System.Func< <>h__TransparentIdentifier0, System.Int32 z>, <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>) (Syntax: 'let g = x + y + z') Instance Receiver: null Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'let g = x + y + z') - ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'let g = x + y + z') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> System.Linq.Enumerable.Select< <>h__TransparentIdentifier0, System.Int32 z>, <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>(this System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>> source, System.Func< <>h__TransparentIdentifier0, System.Int32 z>, <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>) (Syntax: 'let g = x + y + z') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int z in c3') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int z in c3') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>> System.Linq.Enumerable.SelectMany<, System.Int32, <>h__TransparentIdentifier0, System.Int32 z>>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.Collections.Generic.IEnumerable> collectionSelector, System.Func<, System.Int32, <>h__TransparentIdentifier0, System.Int32 z>> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'from int z in c3') + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int z in c3') + IInvocationExpression (System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>> System.Linq.Enumerable.SelectMany<, System.Int32, <>h__TransparentIdentifier0, System.Int32 z>>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.Collections.Generic.IEnumerable> collectionSelector, System.Func<, System.Int32, <>h__TransparentIdentifier0, System.Int32 z>> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable< <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'from int z in c3') + Instance Receiver: null + Arguments(3): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int y in c2') + IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.SelectMany>(this System.Collections.Generic.IEnumerable source, System.Func> collectionSelector, System.Func> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'from int y in c2') + Instance Receiver: null + Arguments(3): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int x in c1') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x in c1') Instance Receiver: null - Arguments(3): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int y in c2') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int y in c2') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.SelectMany>(this System.Collections.Generic.IEnumerable source, System.Func> collectionSelector, System.Func> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'from int y in c2') + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c2') + ReturnedValue: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') Instance Receiver: null - Arguments(3): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int x in c1') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int x in c1') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x in c1') - Instance Receiver: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') - InConversion: null - OutConversion: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c2') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c2') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c2') - ReturnedValue: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') - Instance Receiver: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c2') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') - InConversion: null - OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'from int y in c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'from int y in c2') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from int y in c2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from int y in c2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from int y in c2') + ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Int32 x, System.Int32 y)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'from int y in c2') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'from int y in c2') + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int y in c2') InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'from int y in c2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'from int y in c2') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from int y in c2') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from int y in c2') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from int y in c2') - ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Int32 x, System.Int32 y)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'from int y in c2') - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'from int y in c2') - IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int y in c2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'from int y in c2') - IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int y in c2') - InConversion: null - OutConversion: null - Initializer: null + IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'from int y in c2') + IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int y in c2') InConversion: null OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c3') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.Collections.Generic.IEnumerable>) (Syntax: 'c3') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c3') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c3') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c3') - ReturnedValue: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c3') - Instance Receiver: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c3') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c3') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILocalReferenceExpression: c3 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c3') - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'from int z in c3') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.Int32, <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'from int z in c3') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from int z in c3') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from int z in c3') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from int z in c3') - ReturnedValue: IObjectCreationExpression (Constructor: <>h__TransparentIdentifier0, System.Int32 z>..ctor( <>h__TransparentIdentifier0, System.Int32 z)) (OperationKind.ObjectCreationExpression, Type: <>h__TransparentIdentifier0, System.Int32 z>) (Syntax: 'from int z in c3') - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: <>h__TransparentIdentifier0) (OperationKind.Argument) (Syntax: 'from int z in c3') - IParameterReferenceExpression: <>h__TransparentIdentifier0 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'from int z in c3') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'from int z in c3') - IParameterReferenceExpression: z (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int z in c3') - InConversion: null - OutConversion: null - Initializer: null - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + y + z') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z>, <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>) (Syntax: 'x + y + z') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y + z') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y + z') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y + z') - ReturnedValue: IObjectCreationExpression (Constructor: <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>..ctor( <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g)) (OperationKind.ObjectCreationExpression, Type: <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>) (Syntax: 'let g = x + y + z') - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: <>h__TransparentIdentifier1) (OperationKind.Argument) (Syntax: 'let g = x + y + z') - IParameterReferenceExpression: <>h__TransparentIdentifier1 (OperationKind.ParameterReferenceExpression, Type: <>h__TransparentIdentifier0, System.Int32 z>) (Syntax: 'let g = x + y + z') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: g) (OperationKind.Argument) (Syntax: 'x + y + z') - IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y + z') - Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') - Left: IOperation: (OperationKind.None) (Syntax: 'x') - Right: IOperation: (OperationKind.None) (Syntax: 'y') - Right: IOperation: (OperationKind.None) (Syntax: 'z') - InConversion: null - OutConversion: null - Initializer: null - InConversion: null - OutConversion: null + Initializer: null + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.Collections.Generic.IEnumerable>) (Syntax: 'c3') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c3') + ReturnedValue: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c3') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c3') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c3 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c3') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'from int z in c3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.Int32, <>h__TransparentIdentifier0, System.Int32 z>>) (Syntax: 'from int z in c3') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from int z in c3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from int z in c3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from int z in c3') + ReturnedValue: IObjectCreationExpression (Constructor: <>h__TransparentIdentifier0, System.Int32 z>..ctor( <>h__TransparentIdentifier0, System.Int32 z)) (OperationKind.ObjectCreationExpression, Type: <>h__TransparentIdentifier0, System.Int32 z>) (Syntax: 'from int z in c3') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: <>h__TransparentIdentifier0) (OperationKind.Argument) (Syntax: 'from int z in c3') + IParameterReferenceExpression: <>h__TransparentIdentifier0 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'from int z in c3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: 'from int z in c3') + IParameterReferenceExpression: z (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int z in c3') + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: '(x + y / 10 ... / 100) < 6') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Boolean>) (Syntax: '(x + y / 10 ... / 100) < 6') + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + y + z') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z>, <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>>) (Syntax: 'x + y + z') Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '(x + y / 10 ... / 100) < 6') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '(x + y / 10 ... / 100) < 6') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: '(x + y / 10 ... / 100) < 6') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerLessThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '(x + y / 10 ... / 100) < 6') - Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y / 10 + z / 100') - Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y / 10') - Left: IOperation: (OperationKind.None) (Syntax: 'x') - Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'y / 10') - Left: IOperation: (OperationKind.None) (Syntax: 'y') - Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') - Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'z / 100') - Left: IOperation: (OperationKind.None) (Syntax: 'z') - Right: ILiteralExpression (Text: 100) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 100) (Syntax: '100') - Right: ILiteralExpression (Text: 6) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: '6') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y + z') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y + z') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y + z') + ReturnedValue: IObjectCreationExpression (Constructor: <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>..ctor( <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g)) (OperationKind.ObjectCreationExpression, Type: <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>) (Syntax: 'let g = x + y + z') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: <>h__TransparentIdentifier1) (OperationKind.Argument) (Syntax: 'let g = x + y + z') + IParameterReferenceExpression: <>h__TransparentIdentifier1 (OperationKind.ParameterReferenceExpression, Type: <>h__TransparentIdentifier0, System.Int32 z>) (Syntax: 'let g = x + y + z') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: g) (OperationKind.Argument) (Syntax: 'x + y + z') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y + z') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IOperation: (OperationKind.None) (Syntax: 'y') + Right: IOperation: (OperationKind.None) (Syntax: 'z') + InConversion: null + OutConversion: null + Initializer: null InConversion: null OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'g') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Int32>) (Syntax: 'g') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'g') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'g') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'g') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'g') - InConversion: null - OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: '(x + y / 10 ... / 100) < 6') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Boolean>) (Syntax: '(x + y / 10 ... / 100) < 6') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '(x + y / 10 ... / 100) < 6') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '(x + y / 10 ... / 100) < 6') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '(x + y / 10 ... / 100) < 6') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerLessThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '(x + y / 10 ... / 100) < 6') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y / 10 + z / 100') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y / 10') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'y / 10') + Left: IOperation: (OperationKind.None) (Syntax: 'y') + Right: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'z / 100') + Left: IOperation: (OperationKind.None) (Syntax: 'z') + Right: ILiteralExpression (Text: 100) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 100) (Syntax: '100') + Right: ILiteralExpression (Text: 6) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: '6') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'g') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< <>h__TransparentIdentifier0, System.Int32 z> <>h__TransparentIdentifier1, System.Int32 g>, System.Int32>) (Syntax: 'g') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'g') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'g') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'g') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'g') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -1326,6 +1297,7 @@ from int z in c3 Assert.Equal(z, model.GetSemanticInfoSummary(xPyPz.Right).Symbol); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void RangeVariables_IOperation() { @@ -1350,99 +1322,94 @@ from int z in c3 } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x ... t x + y + z') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x + y + z') - ReducedExpression: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int z in c3') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.SelectMany<, System.Int32, System.Int32>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.Collections.Generic.IEnumerable> collectionSelector, System.Func<, System.Int32, System.Int32> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int z in c3') +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x ... t x + y + z') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.SelectMany<, System.Int32, System.Int32>(this System.Collections.Generic.IEnumerable<> source, System.Func<, System.Collections.Generic.IEnumerable> collectionSelector, System.Func<, System.Int32, System.Int32> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int z in c3') + Instance Receiver: null + Arguments(3): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int y in c2') + IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.SelectMany>(this System.Collections.Generic.IEnumerable source, System.Func> collectionSelector, System.Func> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'from int y in c2') Instance Receiver: null Arguments(3): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int y in c2') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int y in c2') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable<> System.Linq.Enumerable.SelectMany>(this System.Collections.Generic.IEnumerable source, System.Func> collectionSelector, System.Func> resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable<>) (Syntax: 'from int y in c2') - Instance Receiver: null - Arguments(3): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int x in c1') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int x in c1') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x in c1') - Instance Receiver: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c2') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c2') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c2') - ReturnedValue: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') - Instance Receiver: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c2') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'from int y in c2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'from int y in c2') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from int y in c2') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from int y in c2') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from int y in c2') - ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Int32 x, System.Int32 y)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'from int y in c2') - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'from int y in c2') - IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int y in c2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'from int y in c2') - IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int y in c2') - InConversion: null - OutConversion: null - Initializer: null - InConversion: null - OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from int x in c1') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int x in c1') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c1') + InConversion: null + OutConversion: null InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'from int z in c3') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int z in c3') - ReducedExpression: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.Collections.Generic.IEnumerable>) (Syntax: 'c3') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c3') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c3') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c3') - ReturnedValue: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c3') - Instance Receiver: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c3') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c3') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ILocalReferenceExpression: c3 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c3') - InConversion: null - OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c2') + ReturnedValue: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c2') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c2') + InConversion: null + OutConversion: null InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x + y + z') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.Int32, System.Int32>) (Syntax: 'x + y + z') + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'from int y in c2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'from int y in c2') Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y + z') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y + z') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y + z') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y + z') - Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') - Left: IOperation: (OperationKind.None) (Syntax: 'x') - Right: IOperation: (OperationKind.None) (Syntax: 'y') - Right: IOperation: (OperationKind.None) (Syntax: 'z') + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from int y in c2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from int y in c2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from int y in c2') + ReturnedValue: IObjectCreationExpression (Constructor: ..ctor(System.Int32 x, System.Int32 y)) (OperationKind.ObjectCreationExpression, Type: ) (Syntax: 'from int y in c2') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'from int y in c2') + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int y in c2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'from int y in c2') + IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from int y in c2') + InConversion: null + OutConversion: null + Initializer: null InConversion: null OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'c3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.Collections.Generic.IEnumerable>) (Syntax: 'c3') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'c3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'c3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'c3') + ReturnedValue: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'c3') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'c3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'c3') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c3 (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c3') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'x + y + z') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func<, System.Int32, System.Int32>) (Syntax: 'x + y + z') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y + z') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y + z') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y + z') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y + z') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: IOperation: (OperationKind.None) (Syntax: 'y') + Right: IOperation: (OperationKind.None) (Syntax: 'z') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -1596,6 +1563,7 @@ from i in c Assert.Equal("ThenBy", oinfo1.Symbol.Name); } + [CompilerTrait(CompilerFeature.IOperation)] [WorkItem(541774, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541774")] [Fact] public void MultipleFromClauseIdentifierInExprNotInContext() @@ -1614,34 +1582,30 @@ from n2 in nums } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'from n1 in ... select n1') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select n1') - ReducedExpression: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from n2 in nums') - ReducedExpression: IInvocationExpression (? Program.SelectMany()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'from n2 in nums') - Instance Receiver: null - Arguments(3): - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from n1 in nums') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from n1 in nums') - ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'nums') - Children(0) - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from n2 in nums') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from n2 in nums') - ReducedExpression: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'nums') - IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'nums') - IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'nums') - ReturnedValue: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'nums') - Children(0) - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'n1') - ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'n1') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'n1') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'n1') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'n1') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'from n1 in ... select n1') + Expression: IInvocationExpression (? Program.SelectMany()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'from n2 in nums') + Instance Receiver: null + Arguments(3): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'nums') + IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'nums') + Children(0) + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'nums') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'nums') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'nums') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'nums') + ReturnedValue: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'nums') + Children(0) + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'n1') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'n1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'n1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'n1') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'n1') + InConversion: null + OutConversion: null "; var expectedDiagnostics = new DiagnosticDescription[] { // CS0103: The name 'nums' does not exist in the current context @@ -1655,6 +1619,7 @@ from n2 in nums VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } + [CompilerTrait(CompilerFeature.IOperation)] [WorkItem(541906, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541906")] [Fact] public void NullLiteralFollowingJoinInQuery() @@ -1671,63 +1636,60 @@ static void Main(string[] args) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'from int i ... ue select i') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select i') - ReducedExpression: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'join null o ... equals true') - ReducedExpression: IInvocationExpression (? Program.Join()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'join null o ... equals true') +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'from int i ... ue select i') + Expression: IInvocationExpression (? Program.Join()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'join null o ... equals true') + Instance Receiver: null + Arguments(5): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'from int i ... int[] { 1 }') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i ... int[] { 1 }') Instance Receiver: null - Arguments(5): - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'from int i ... int[] { 1 }') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from int i ... int[] { 1 }') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from int i ... int[] { 1 }') - Instance Receiver: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'new int[] { 1 }') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'new int[] { 1 }') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32[]) (Syntax: 'new int[] { 1 }') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'new int[] { 1 }') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{ 1 }') - Element Values(1): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'join null o ... equals true') - IInvocationExpression (? Program.Cast()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'join null o ... equals true') - Instance Receiver: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'null') - IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'null') - Children(1): - ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null, IsInvalid) (Syntax: 'null') - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'true') - ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'true') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'true') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'true') - ReturnedValue: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'true') - ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'true') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'true') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'true') - ReturnedValue: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'new int[] { 1 }') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'new int[] { 1 }') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32[]) (Syntax: 'new int[] { 1 }') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'new int[] { 1 }') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{ 1 }') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'i') - ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'i') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'join null o ... equals true') + IInvocationExpression (? Program.Cast()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'join null o ... equals true') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'null') + IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'null') + Children(1): + ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null, IsInvalid) (Syntax: 'null') InConversion: null OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'true') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'true') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'true') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'true') + ReturnedValue: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'true') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'true') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'true') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'true') + ReturnedValue: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'i') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'i') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'i') + InConversion: null + OutConversion: null "; var expectedDiagnostics = new DiagnosticDescription[] { // CS1031: Type expected @@ -1831,6 +1793,7 @@ join b in Enumerable.Range(1, 13) on 4 * a equals b CompileAndVerify(csSource, additionalRefs: new[] { LinqAssemblyRef }, expectedOutput: "1 2 3"); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] public void JoinClause_IOperation() { @@ -1857,70 +1820,67 @@ join b in Enumerable.Range(1, 13) on 4 * a equals b } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from a in E ... select a') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select a') - ReducedExpression: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'join b in E ... a equals b') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Join(this System.Collections.Generic.IEnumerable outer, System.Collections.Generic.IEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'join b in E ... a equals b') +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from a in E ... select a') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Join(this System.Collections.Generic.IEnumerable outer, System.Collections.Generic.IEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func resultSelector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'join b in E ... a equals b') + Instance Receiver: null + Arguments(5): + IArgument (ArgumentKind.Explicit, Matching Parameter: outer) (OperationKind.Argument) (Syntax: 'Enumerable.Range(1, 13)') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Range(System.Int32 start, System.Int32 count)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'Enumerable.Range(1, 13)') Instance Receiver: null - Arguments(5): - IArgument (ArgumentKind.Explicit, Matching Parameter: outer) (OperationKind.Argument) (Syntax: 'from a in E ... ange(1, 13)') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from a in E ... ange(1, 13)') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Range(System.Int32 start, System.Int32 count)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'Enumerable.Range(1, 13)') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: start) (OperationKind.Argument) (Syntax: '1') - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: count) (OperationKind.Argument) (Syntax: '13') - ILiteralExpression (Text: 13) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 13) (Syntax: '13') - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'Enumerable.Range(1, 13)') - IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Range(System.Int32 start, System.Int32 count)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'Enumerable.Range(1, 13)') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: start) (OperationKind.Argument) (Syntax: '1') - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: count) (OperationKind.Argument) (Syntax: '13') - ILiteralExpression (Text: 13) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 13) (Syntax: '13') - InConversion: null - OutConversion: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: start) (OperationKind.Argument) (Syntax: '1') + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: '4 * a') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: '4 * a') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '4 * a') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '4 * a') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: '4 * a') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '4 * a') - Left: ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') - Right: IOperation: (OperationKind.None) (Syntax: 'a') + IArgument (ArgumentKind.Explicit, Matching Parameter: count) (OperationKind.Argument) (Syntax: '13') + ILiteralExpression (Text: 13) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 13) (Syntax: '13') InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 'b') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'b') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'b') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'b') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'b') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'b') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'Enumerable.Range(1, 13)') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Range(System.Int32 start, System.Int32 count)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'Enumerable.Range(1, 13)') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: start) (OperationKind.Argument) (Syntax: '1') + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: null OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'a') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'a') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'a') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'a') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'a') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'a') + IArgument (ArgumentKind.Explicit, Matching Parameter: count) (OperationKind.Argument) (Syntax: '13') + ILiteralExpression (Text: 13) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 13) (Syntax: '13') InConversion: null OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: '4 * a') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: '4 * a') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '4 * a') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '4 * a') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '4 * a') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '4 * a') + Left: ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + Right: IOperation: (OperationKind.None) (Syntax: 'a') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 'b') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'b') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'b') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'b') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'b') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'b') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'a') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'a') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'a') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'a') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'a') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'a') + InConversion: null + OutConversion: null "; var expectedDiagnostics = DiagnosticDescription.None; @@ -2580,6 +2540,7 @@ class P Assert.Null(symbolInfo.Symbol); } + [CompilerTrait(CompilerFeature.IOperation)] [WorkItem(542559, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542559")] [Fact] public void StaticTypeInFromClause() @@ -2598,32 +2559,30 @@ static void Main() } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'from GC x i ... ty select x') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x') - ReducedExpression: IInvocationExpression (? C.Select()) (OperationKind.InvocationExpression, Type: ?) (Syntax: 'select x') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from GC x i ... tring.Empty') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from GC x i ... tring.Empty') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable, IsInvalid) (Syntax: 'from GC x i ... tring.Empty') - Instance Receiver: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'string.Empty') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable, IsInvalid) (Syntax: 'string.Empty') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: IFieldReferenceExpression: System.String System.String.Empty (Static) (OperationKind.FieldReferenceExpression, Type: System.String, IsInvalid) (Syntax: 'string.Empty') - Instance Receiver: null - InConversion: null - OutConversion: null - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'x') - ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'x') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'from GC x i ... ty select x') + Expression: IInvocationExpression (? C.Select()) (OperationKind.InvocationExpression, Type: ?) (Syntax: 'select x') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from GC x i ... tring.Empty') + IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Cast(this System.Collections.IEnumerable source)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable, IsInvalid) (Syntax: 'from GC x i ... tring.Empty') + Instance Receiver: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'string.Empty') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable, IsInvalid) (Syntax: 'string.Empty') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: IFieldReferenceExpression: System.String System.String.Empty (Static) (OperationKind.FieldReferenceExpression, Type: System.String, IsInvalid) (Syntax: 'string.Empty') + Instance Receiver: null + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'x') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'x') + InConversion: null + OutConversion: null "; var expectedDiagnostics = new DiagnosticDescription[] { // CS0718: 'GC': static types cannot be used as type arguments @@ -2637,6 +2596,7 @@ static void Main() VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } + [CompilerTrait(CompilerFeature.IOperation)] [WorkItem(542560, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542560")] [Fact] public void MethodGroupInFromClause() @@ -2655,25 +2615,23 @@ static void Main() } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'from y in Main select y') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select y') - ReducedExpression: IInvocationExpression (? Program.Select()) (OperationKind.InvocationExpression, Type: ?) (Syntax: 'select y') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from y in Main') - IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'from y in Main') - Children(1): - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from y in Main') - ReducedExpression: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Main') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'y') - ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'y') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'y') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'y') - ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'y') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'from y in Main select y') + Expression: IInvocationExpression (? Program.Select()) (OperationKind.InvocationExpression, Type: ?) (Syntax: 'select y') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from y in Main') + IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'from y in Main') + Children(1): + IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Main') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'y') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'y') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'y') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'y') + ReturnedValue: IOperation: (OperationKind.None) (Syntax: 'y') + InConversion: null + OutConversion: null "; var expectedDiagnostics = new DiagnosticDescription[] { // CS0119: 'Program.Main()' is a method, which is not valid in the given context @@ -2828,6 +2786,7 @@ static int Main() compilation.VerifyDiagnostics(); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void RangeTypeAlreadySpecified() { @@ -2851,27 +2810,25 @@ class CastableToArrayList } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'from int x ... elect x + 1') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select x + 1') - ReducedExpression: IInvocationExpression (? Test.Select()) (OperationKind.InvocationExpression, Type: ?) (Syntax: 'select x + 1') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from int x in list') - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from int x in list') - ReducedExpression: IInvocationExpression ( System.Collections.ArrayList CastableToArrayList.Cast()) (OperationKind.InvocationExpression, Type: System.Collections.ArrayList, IsInvalid) (Syntax: 'from int x in list') - Instance Receiver: ILocalReferenceExpression: list (OperationKind.LocalReferenceExpression, Type: CastableToArrayList, IsInvalid) (Syntax: 'list') - Arguments(0) - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'x + 1') - ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + 1') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + 1') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + 1') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.Invalid) (OperationKind.BinaryOperatorExpression, Type: ?) (Syntax: 'x + 1') - Left: IOperation: (OperationKind.None) (Syntax: 'x') - Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'from int x ... elect x + 1') + Expression: IInvocationExpression (? Test.Select()) (OperationKind.InvocationExpression, Type: ?) (Syntax: 'select x + 1') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from int x in list') + IInvocationExpression ( System.Collections.ArrayList CastableToArrayList.Cast()) (OperationKind.InvocationExpression, Type: System.Collections.ArrayList, IsInvalid) (Syntax: 'from int x in list') + Instance Receiver: ILocalReferenceExpression: list (OperationKind.LocalReferenceExpression, Type: CastableToArrayList, IsInvalid) (Syntax: 'list') + Arguments(0) + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'x + 1') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + 1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.Invalid) (OperationKind.BinaryOperatorExpression, Type: ?) (Syntax: 'x + 1') + Left: IOperation: (OperationKind.None) (Syntax: 'x') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null "; var expectedDiagnostics = new DiagnosticDescription[] { // CS1936: Could not find an implementation of the query pattern for source type 'ArrayList'. 'Select' not found. @@ -2956,6 +2913,7 @@ public static void Main () Assert.NotNull(queryInfo); } + [CompilerTrait(CompilerFeature.IOperation)] [WorkItem(545797, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545797")] [Fact] public void QueryOnNull() @@ -2976,25 +2934,23 @@ static object Select(this object x, Func y) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Object, IsInvalid) (Syntax: 'from x in null select x') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'select x') - ReducedExpression: IInvocationExpression (System.Object C.Select(this System.Object x, System.Func y)) (OperationKind.InvocationExpression, Type: System.Object, IsInvalid) (Syntax: 'select x') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'from x in null') - IInvalidExpression (OperationKind.InvalidExpression, Type: ?) (Syntax: 'from x in null') - Children(1): - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in null') - ReducedExpression: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'x') - ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'x') - IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'x') - IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'x') - ReturnedValue: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'x') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Object, IsInvalid) (Syntax: 'from x in null select x') + Expression: IInvocationExpression (System.Object C.Select(this System.Object x, System.Func y)) (OperationKind.InvocationExpression, Type: System.Object, IsInvalid) (Syntax: 'select x') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'from x in null') + IInvalidExpression (OperationKind.InvalidExpression, Type: ?) (Syntax: 'from x in null') + Children(1): + ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'x') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'x') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'x') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'x') + ReturnedValue: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'x') + InConversion: null + OutConversion: null "; var expectedDiagnostics = new DiagnosticDescription[] { // CS0186: Use of null is not valid in this context @@ -3005,6 +2961,7 @@ static object Select(this object x, Func y) VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } + [CompilerTrait(CompilerFeature.IOperation)] [WorkItem(545797, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545797")] [Fact] public void QueryOnLambda() @@ -3025,28 +2982,26 @@ static object Select(this object x, Func y) } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Object, IsInvalid) (Syntax: 'from x in y ... y select x') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'select x') - ReducedExpression: IInvocationExpression (System.Object C.Select(this System.Object x, System.Func y)) (OperationKind.InvocationExpression, Type: System.Object, IsInvalid) (Syntax: 'select x') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'from x in y => y') - IInvalidExpression (OperationKind.InvalidExpression, Type: ?) (Syntax: 'from x in y => y') - Children(1): - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in y => y') - ReducedExpression: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'y => y') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'y') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'y') - ReturnedValue: IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: ?) (Syntax: 'y') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'x') - ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'x') - IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'x') - IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'x') - ReturnedValue: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'x') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Object, IsInvalid) (Syntax: 'from x in y ... y select x') + Expression: IInvocationExpression (System.Object C.Select(this System.Object x, System.Func y)) (OperationKind.InvocationExpression, Type: System.Object, IsInvalid) (Syntax: 'select x') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: 'from x in y => y') + IInvalidExpression (OperationKind.InvalidExpression, Type: ?) (Syntax: 'from x in y => y') + Children(1): + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'y => y') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'y') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'y') + ReturnedValue: IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: ?) (Syntax: 'y') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'x') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'x') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'x') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'x') + ReturnedValue: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'x') + InConversion: null + OutConversion: null "; var expectedDiagnostics = new DiagnosticDescription[] { // CS1936: Could not find an implementation of the query pattern for source type 'anonymous method'. 'Select' not found. @@ -3413,6 +3368,7 @@ x descending Assert.Equal(3, count); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact] public void BrokenQueryPattern() { @@ -3447,70 +3403,66 @@ where x.ToString() == y.ToString() } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: X, IsInvalid) (Syntax: 'from x in q ... .ToString()') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'select x.ToString()') - ReducedExpression: IInvocationExpression ( X X.Select(System.Func f1)) (OperationKind.InvocationExpression, Type: X, IsInvalid) (Syntax: 'select x.ToString()') - Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'where x.ToS ... .ToString()') - ReducedExpression: IInvocationExpression ( X Q< y>>.Where(System.Func< y>, System.Boolean> f1)) (OperationKind.InvocationExpression, Type: X) (Syntax: 'where x.ToS ... .ToString()') - Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from y in q') - ReducedExpression: IInvocationExpression ( Q< y>> Q.SelectMany, y>>(System.Func> f1, System.Func, y>> f2)) (OperationKind.InvocationExpression, Type: Q< y>>) (Syntax: 'from y in q') - Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from x in q') - ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: Q) (Syntax: 'q') - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: f1) (OperationKind.Argument) (Syntax: 'q') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'q') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'q') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'q') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'q') - ReturnedValue: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: Q) (Syntax: 'q') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: f2) (OperationKind.Argument) (Syntax: 'from y in q') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func, y>>) (Syntax: 'from y in q') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from y in q') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from y in q') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from y in q') - ReturnedValue: IObjectCreationExpression (Constructor: y>..ctor(System.Int32 x, Q y)) (OperationKind.ObjectCreationExpression, Type: y>) (Syntax: 'from y in q') - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'from y in q') - IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from y in q') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'from y in q') - IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: Q) (Syntax: 'from y in q') - InConversion: null - OutConversion: null - Initializer: null - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: f1) (OperationKind.Argument) (Syntax: 'x.ToString( ... .ToString()') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< y>, System.Boolean>) (Syntax: 'x.ToString( ... .ToString()') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x.ToString( ... .ToString()') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x.ToString( ... .ToString()') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x.ToString( ... .ToString()') - ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.StringEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'x.ToString( ... .ToString()') - Left: IInvocationExpression (virtual System.String System.Int32.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'x.ToString()') - Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'x') - Arguments(0) - Right: IInvocationExpression (virtual System.String System.Object.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'y.ToString()') - Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'y') - Arguments(0) - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: X, IsInvalid) (Syntax: 'from x in q ... .ToString()') + Expression: IInvocationExpression ( X X.Select(System.Func f1)) (OperationKind.InvocationExpression, Type: X, IsInvalid) (Syntax: 'select x.ToString()') + Instance Receiver: IInvocationExpression ( X Q< y>>.Where(System.Func< y>, System.Boolean> f1)) (OperationKind.InvocationExpression, Type: X) (Syntax: 'where x.ToS ... .ToString()') + Instance Receiver: IInvocationExpression ( Q< y>> Q.SelectMany, y>>(System.Func> f1, System.Func, y>> f2)) (OperationKind.InvocationExpression, Type: Q< y>>) (Syntax: 'from y in q') + Instance Receiver: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: Q) (Syntax: 'q') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: f1) (OperationKind.Argument) (Syntax: 'q') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>) (Syntax: 'q') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'q') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'q') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'q') + ReturnedValue: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: Q) (Syntax: 'q') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: f2) (OperationKind.Argument) (Syntax: 'from y in q') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func, y>>) (Syntax: 'from y in q') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'from y in q') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'from y in q') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'from y in q') + ReturnedValue: IObjectCreationExpression (Constructor: y>..ctor(System.Int32 x, Q y)) (OperationKind.ObjectCreationExpression, Type: y>) (Syntax: 'from y in q') + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'from y in q') + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'from y in q') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'from y in q') + IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: Q) (Syntax: 'from y in q') + InConversion: null + OutConversion: null + Initializer: null + InConversion: null + OutConversion: null Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'x.ToString()') - ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'x.ToString()') - IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'x.ToString()') - IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'x.ToString()') - ReturnedValue: IInvocationExpression ( ? Program.()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'x.ToString()') - Instance Receiver: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'x.ToString') - Arguments(0) + IArgument (ArgumentKind.Explicit, Matching Parameter: f1) (OperationKind.Argument) (Syntax: 'x.ToString( ... .ToString()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func< y>, System.Boolean>) (Syntax: 'x.ToString( ... .ToString()') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x.ToString( ... .ToString()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x.ToString( ... .ToString()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x.ToString( ... .ToString()') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.StringEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'x.ToString( ... .ToString()') + Left: IInvocationExpression (virtual System.String System.Int32.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'x.ToString()') + Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'x') + Arguments(0) + Right: IInvocationExpression (virtual System.String System.Object.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'y.ToString()') + Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'y') + Arguments(0) InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'x.ToString()') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'x.ToString()') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'x.ToString()') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'x.ToString()') + ReturnedValue: IInvocationExpression ( ? Program.()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'x.ToString()') + Instance Receiver: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'x.ToString') + Arguments(0) + InConversion: null + OutConversion: null "; var expectedDiagnostics = new DiagnosticDescription[] { // CS8016: Transparent identifier member access failed for field 'x' of 'int'. Does the data being queried implement the query pattern? @@ -3892,6 +3844,7 @@ public ValueTuple(T1 item1, T2 item2) ); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(14689, "https://github.com/dotnet/roslyn/issues/14689")] public void SelectFromNamespaceShouldGiveAnError() { @@ -3916,25 +3869,23 @@ static void Main() } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'from c in N ... as select 3') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'select 3') - ReducedExpression: IInvocationExpression (? ParentNamespace.ConsoleApp.Program.Select()) (OperationKind.InvocationExpression, Type: ?) (Syntax: 'select 3') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from c in NSAlias') - IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'from c in NSAlias') - Children(1): - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'from c in NSAlias') - ReducedExpression: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'NSAlias') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: '3') - ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '3') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '3') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: '3') - ReturnedValue: ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'from c in N ... as select 3') + Expression: IInvocationExpression (? ParentNamespace.ConsoleApp.Program.Select()) (OperationKind.InvocationExpression, Type: ?) (Syntax: 'select 3') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument, IsInvalid) (Syntax: 'from c in NSAlias') + IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'from c in NSAlias') + Children(1): + IOperation: (OperationKind.None, IsInvalid) (Syntax: 'NSAlias') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: null) (OperationKind.Argument) (Syntax: '3') + ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '3') + ReturnedValue: ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null "; var expectedDiagnostics = new DiagnosticDescription[] { // CS0119: 'ConsoleApp' is a namespace, which is not valid in the given context @@ -3951,6 +3902,7 @@ static void Main() VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } + [CompilerTrait(CompilerFeature.IOperation)] [Fact, WorkItem(12052, "https://github.com/dotnet/roslyn/issues/12052")] public void LambdaParameterConflictsWithRangeVariable() { @@ -3968,37 +3920,35 @@ static void Main() } "; string expectedOperationTree = @" -IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable>, IsInvalid) (Syntax: 'from a in n ... t>)(a => 1)') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'select (Fun ... t>)(a => 1)') - ReducedExpression: IInvocationExpression (System.Collections.Generic.IEnumerable> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable>, IsInvalid) (Syntax: 'select (Fun ... t>)(a => 1)') - Instance Receiver: null - Arguments(2): - IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from a in new[] { 1 }') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from a in new[] { 1 }') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'from a in new[] { 1 }') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32[]) (Syntax: 'new[] { 1 }') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'new[] { 1 }') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{ 1 }') - Element Values(1): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument, IsInvalid) (Syntax: '(Func)(a => 1)') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>, IsInvalid) (Syntax: '(Func)(a => 1)') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: '(Func)(a => 1)') - IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: '(Func)(a => 1)') - IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: '(Func)(a => 1)') - ReturnedValue: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func, IsInvalid) (Syntax: '(Func)(a => 1)') - Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'a => 1') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '1') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: '1') - ReturnedValue: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable>, IsInvalid) (Syntax: 'from a in n ... t>)(a => 1)') + Expression: IInvocationExpression (System.Collections.Generic.IEnumerable> System.Linq.Enumerable.Select>(this System.Collections.Generic.IEnumerable source, System.Func> selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable>, IsInvalid) (Syntax: 'select (Fun ... t>)(a => 1)') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from a in new[] { 1 }') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from a in new[] { 1 }') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32[]) (Syntax: 'new[] { 1 }') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'new[] { 1 }') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{ 1 }') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument, IsInvalid) (Syntax: '(Func)(a => 1)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func>, IsInvalid) (Syntax: '(Func)(a => 1)') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: '(Func)(a => 1)') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: '(Func)(a => 1)') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: '(Func)(a => 1)') + ReturnedValue: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func, IsInvalid) (Syntax: '(Func)(a => 1)') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'a => 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '1') + ReturnedValue: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null "; var expectedDiagnostics = new DiagnosticDescription[] { // CS0136: A local or parameter named 'a' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter diff --git a/src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs b/src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs index 6e837642ed5c5..a9657d6ff5828 100644 --- a/src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs +++ b/src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs @@ -5642,149 +5642,21 @@ public LazyCollectionElementInitializerExpression(IMethodSymbol addMethod, Lazy< } /// - /// Represents a query expression in C# or VB. + /// Represents an unrolled/lowered query expression in C# and VB. + /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, + /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. /// - internal abstract partial class BaseQueryExpression : Operation, IQueryExpression + internal abstract partial class BaseTranslatedQueryExpression : Operation, ITranslatedQueryExpression { - protected BaseQueryExpression(SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(OperationKind.QueryExpression, semanticModel, syntax, type, constantValue) + protected BaseTranslatedQueryExpression(SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(OperationKind.TranslatedQueryExpression, semanticModel, syntax, type, constantValue) { } - protected abstract IOperation LastClauseOrContinuationImpl { get; } - /// - /// Last or in the unrolled query expression. - /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, - /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. - /// - public IOperation LastClauseOrContinuation => Operation.SetParentOperation(LastClauseOrContinuationImpl, this); - public override IEnumerable Children - { - get - { - yield return LastClauseOrContinuation; - } - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitQueryExpression(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitQueryExpression(this, argument); - } - } - - /// - /// Represents a query expression in C# or VB. - /// - internal sealed partial class QueryExpression : BaseQueryExpression, IQueryExpression - { - public QueryExpression(IOperation lastClauseOrContinuation, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(semanticModel, syntax, type, constantValue) - { - LastClauseOrContinuationImpl = lastClauseOrContinuation; - } - protected override IOperation LastClauseOrContinuationImpl { get; } - } - - /// - /// Represents a query expression in C# or VB. - /// - internal sealed partial class LazyQueryExpression : BaseQueryExpression, IQueryExpression - { - private readonly Lazy _lazyLastClauseOrContinuation; - - public LazyQueryExpression(Lazy lastClauseOrContinuation, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(semanticModel, syntax, type, constantValue) - { - _lazyLastClauseOrContinuation = lastClauseOrContinuation ?? throw new System.ArgumentNullException(nameof(lastClauseOrContinuation)); - } - protected override IOperation LastClauseOrContinuationImpl => _lazyLastClauseOrContinuation.Value; - } - - /// - /// Represents an ordering expression within an in C# or VB. - /// - internal abstract partial class BaseOrderingExpression : Operation, IOrderingExpression - { - protected BaseOrderingExpression(OrderKind orderKind, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(OperationKind.OrderingExpression, semanticModel, syntax, type, constantValue) - { - OrderKind = orderKind; - } - /// - /// for the ordering expression. - /// - public OrderKind OrderKind { get; } - /// - /// Underlying ordering expression for the order by query clause. - /// - public IOperation Expression => Operation.SetParentOperation(ExpressionImpl, this); protected abstract IOperation ExpressionImpl { get; } - public override IEnumerable Children - { - get - { - yield return Expression; - } - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitOrderingExpression(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitOrderingExpression(this, argument); - } - } - - /// - /// Represents an ordering expression within an in C# or VB. - /// - internal sealed partial class OrderingExpression : BaseOrderingExpression, IOrderingExpression - { - public OrderingExpression(IOperation expression, OrderKind orderKind, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(orderKind, semanticModel, syntax, type, constantValue) - { - ExpressionImpl = expression; - } - protected override IOperation ExpressionImpl { get; } - } - - /// - /// Represents an ordering expression within an in C# or VB. - /// - internal sealed partial class LazyOrderingExpression : BaseOrderingExpression, IOrderingExpression - { - private readonly Lazy _lazyExression; - - public LazyOrderingExpression(Lazy expression, OrderKind orderKind, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(orderKind, semanticModel, syntax, type, constantValue) - { - _lazyExression = expression ?? throw new System.ArgumentNullException(nameof(expression)); - } - protected override IOperation ExpressionImpl => _lazyExression.Value; - } - - /// - /// Represents a group or function aggregation expression inside an Into clause of a Group By or Aggregate query clause in VB. - /// - internal abstract partial class BaseAggregationExpression : Operation, IAggregationExpression - { - protected BaseAggregationExpression(bool isGroupAggregation, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(OperationKind.AggregationExpression, semanticModel, syntax, type, constantValue) - { - IsGroupAggregation = isGroupAggregation; - } /// - /// Flag indicating if this is a group aggregation clause. - /// - public bool IsGroupAggregation { get; } - /// - /// Aggregation expression. + /// Underlying unrolled expression. /// public IOperation Expression => Operation.SetParentOperation(ExpressionImpl, this); - protected abstract IOperation ExpressionImpl { get; } public override IEnumerable Children { get @@ -5794,21 +5666,23 @@ public override IEnumerable Children } public override void Accept(OperationVisitor visitor) { - visitor.VisitAggregationExpression(this); + visitor.VisitTranslatedQueryExpression(this); } public override TResult Accept(OperationVisitor visitor, TArgument argument) { - return visitor.VisitAggregationExpression(this, argument); + return visitor.VisitTranslatedQueryExpression(this, argument); } } /// - /// Represents a group or function aggregation expression inside an Into clause of a Group By or Aggregate query clause in VB. + /// Represents an unrolled/lowered query expression in C# and VB. + /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, + /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. /// - internal sealed partial class AggregationExpression : BaseAggregationExpression, IAggregationExpression + internal sealed partial class TranslatedQueryExpression : BaseTranslatedQueryExpression, ITranslatedQueryExpression { - public AggregationExpression(IOperation expression, bool isGroupAggregation, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(isGroupAggregation, semanticModel, syntax, type, constantValue) + public TranslatedQueryExpression(IOperation expression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(semanticModel, syntax, type, constantValue) { ExpressionImpl = expression; } @@ -5816,707 +5690,19 @@ public AggregationExpression(IOperation expression, bool isGroupAggregation, Sem } /// - /// Represents a group or function aggregation expression inside an Into clause of a Group By or Aggregate query clause in VB. - /// - internal sealed partial class LazyAggregationExpression : BaseAggregationExpression, IAggregationExpression - { - private readonly Lazy _lazyExression; - - public LazyAggregationExpression(Lazy expression, bool isGroupAggregation, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(isGroupAggregation, semanticModel, syntax, type, constantValue) - { - _lazyExression = expression ?? throw new System.ArgumentNullException(nameof(expression)); - } - protected override IOperation ExpressionImpl => _lazyExression.Value; - } - - /// - /// Represents a query continuation in C#. - /// - internal abstract partial class BaseQueryContinuation : Operation, IQueryContinuation - { - protected BaseQueryContinuation(IRangeVariableSymbol declaredSymbol, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(OperationKind.QueryContinuation, semanticModel, syntax, type, constantValue) - { - DeclaredSymbol = declaredSymbol; - } - /// - /// Declared symbol. - /// - public IRangeVariableSymbol DeclaredSymbol { get; } - /// - /// Query body of the continuation. - /// - public IOperation QueryBody => Operation.SetParentOperation(QueryBodyImpl, this); - protected abstract IOperation QueryBodyImpl { get; } - public override IEnumerable Children - { - get - { - yield return QueryBody; - } - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitQueryContinuation(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitQueryContinuation(this, argument); - } - } - - /// - /// Represents a query continuation in C#. - /// - internal sealed partial class QueryContinuation : BaseQueryContinuation, IQueryContinuation - { - public QueryContinuation(IOperation queryBody, IRangeVariableSymbol definedSymbol, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(definedSymbol, semanticModel, syntax, type, constantValue) - { - QueryBodyImpl = queryBody; - } - protected override IOperation QueryBodyImpl { get; } - } - - /// - /// Represents a query continuation in C#. - /// - internal sealed partial class LazyQueryContinuation : BaseQueryContinuation, IQueryContinuation - { - private readonly Lazy _lazyQueryBody; - - public LazyQueryContinuation(Lazy queryBody, IRangeVariableSymbol definedSymbol, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(definedSymbol, semanticModel, syntax, type, constantValue) - { - _lazyQueryBody = queryBody ?? throw new System.ArgumentNullException(nameof(queryBody)); - } - protected override IOperation QueryBodyImpl => _lazyQueryBody.Value; - } - - /// - /// Represents a query clause in C# or VB. - /// - internal abstract partial class BaseQueryClause : Operation, IQueryClause - { - protected BaseQueryClause(QueryClauseKind clauseKind, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(OperationKind.QueryClause, semanticModel, syntax, type, constantValue) - { - ClauseKind = clauseKind; - } - /// - /// of the clause. - /// - public QueryClauseKind ClauseKind { get; } - /// - /// Underlying reduced expression for the query clause. This is normally the invocation expression for the underlying linq call. - /// - public IOperation ReducedExpression => Operation.SetParentOperation(ReducedExpressionImpl, this); - protected abstract IOperation ReducedExpressionImpl { get; } - public override IEnumerable Children - { - get - { - yield return ReducedExpression; - } - } - } - - /// - /// Represents a query clause in C# or VB. - /// - internal abstract partial class QueryClause : BaseQueryClause, IQueryClause - { - protected QueryClause(IOperation reducedExpression, QueryClauseKind clauseKind, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(clauseKind, semanticModel, syntax, type, constantValue) - { - ReducedExpressionImpl = reducedExpression; - } - protected override IOperation ReducedExpressionImpl { get; } - } - - /// - /// Represents a query clause in C# or VB. - /// - internal abstract partial class LazyQueryClause : BaseQueryClause, IQueryClause - { - private readonly Lazy _lazyReducedExpression; - - protected LazyQueryClause(Lazy reducedExpression, QueryClauseKind clauseKind, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(clauseKind, semanticModel, syntax, type, constantValue) - { - _lazyReducedExpression = reducedExpression ?? throw new System.ArgumentNullException(nameof(reducedExpression)); - } - protected override IOperation ReducedExpressionImpl => _lazyReducedExpression.Value; - } - - /// - /// Represents a from query clause in C# or VB. - /// - internal sealed partial class FromQueryClause : QueryClause, IFromQueryClause - { - public FromQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.FromClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitFromQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitFromQueryClause(this, argument); - } - } - - /// - /// Represents a from query clause in C# or VB. - /// - internal sealed partial class LazyFromQueryClause : LazyQueryClause, IFromQueryClause - { - public LazyFromQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.FromClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitFromQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitFromQueryClause(this, argument); - } - } - - /// - /// Represents a select query clause in C# or VB. - /// - internal sealed partial class SelectQueryClause : QueryClause, ISelectQueryClause - { - public SelectQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.SelectClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitSelectQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitSelectQueryClause(this, argument); - } - } - - /// - /// Represents a select query clause in C# or VB. - /// - internal sealed partial class LazySelectQueryClause : LazyQueryClause, ISelectQueryClause - { - public LazySelectQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.SelectClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitSelectQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitSelectQueryClause(this, argument); - } - } - - /// - /// Represents a where query clause in C# or VB. - /// - internal sealed partial class WhereQueryClause : QueryClause, IWhereQueryClause - { - public WhereQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.WhereClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitWhereQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitWhereQueryClause(this, argument); - } - } - - /// - /// Represents a where query clause in C# or VB. - /// - internal sealed partial class LazyWhereQueryClause : LazyQueryClause, IWhereQueryClause - { - public LazyWhereQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.WhereClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitWhereQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitWhereQueryClause(this, argument); - } - } - - /// - /// Represents a let query clause in C# or VB. + /// Represents an unrolled/lowered query expression in C# and VB. + /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, + /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. /// - internal sealed partial class LetQueryClause : QueryClause, ILetQueryClause + internal sealed partial class LazyTranslatedQueryExpression : BaseTranslatedQueryExpression, ITranslatedQueryExpression { - public LetQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.LetClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitLetQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitLetQueryClause(this, argument); - } - } + private readonly Lazy _lazyExpression; - /// - /// Represents a let query clause in C# or VB. - /// - internal sealed partial class LazyLetQueryClause : LazyQueryClause, ILetQueryClause - { - public LazyLetQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.LetClause, semanticModel, syntax, type, constantValue) + public LazyTranslatedQueryExpression(Lazy expression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : + base(semanticModel, syntax, type, constantValue) { + _lazyExpression = expression ?? throw new System.ArgumentNullException(nameof(expression)); } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitLetQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitLetQueryClause(this, argument); - } - } - - /// - /// Represents an order by query clause in C# or VB. - /// - internal sealed partial class OrderByQueryClause : QueryClause, IOrderByQueryClause - { - public OrderByQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.OrderByClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitOrderByQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitOrderByQueryClause(this, argument); - } - } - - /// - /// Represents an order by query clause in C# or VB. - /// - internal sealed partial class LazyOrderByQueryClause : LazyQueryClause, IOrderByQueryClause - { - public LazyOrderByQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.OrderByClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitOrderByQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitOrderByQueryClause(this, argument); - } - } - - /// - /// Represents a group by query clause in C# or VB. - /// - internal sealed partial class GroupByQueryClause : QueryClause, IGroupByQueryClause - { - public GroupByQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.GroupByClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitGroupByQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitGroupByQueryClause(this, argument); - } - } - - /// - /// Represents a group by query clause in C# or VB. - /// - internal sealed partial class LazyGroupByQueryClause : LazyQueryClause, IGroupByQueryClause - { - public LazyGroupByQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.GroupByClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitGroupByQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitGroupByQueryClause(this, argument); - } - } - - /// - /// Represents a group join query clause in VB. - /// - internal sealed partial class GroupJoinQueryClause : QueryClause, IGroupJoinQueryClause - { - public GroupJoinQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.GroupJoinClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitGroupJoinQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitGroupJoinQueryClause(this, argument); - } - } - - /// - /// Represents a group join query clause in VB. - /// - internal sealed partial class LazyGroupJoinQueryClause : LazyQueryClause, IGroupJoinQueryClause - { - public LazyGroupJoinQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.GroupJoinClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitGroupJoinQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitGroupJoinQueryClause(this, argument); - } - } - - /// - /// Represents a join query clause in C# or VB. - /// - internal sealed partial class JoinQueryClause : QueryClause, IJoinQueryClause - { - public JoinQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.JoinClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitJoinQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitJoinQueryClause(this, argument); - } - } - - /// - /// Represents a join query clause in C# or VB. - /// - internal sealed partial class LazyJoinQueryClause : LazyQueryClause, IJoinQueryClause - { - public LazyJoinQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.JoinClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitJoinQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitJoinQueryClause(this, argument); - } - } - - /// - /// Represents a join into query clause in C#. - /// - internal sealed partial class JoinIntoQueryClause : QueryClause, IJoinIntoQueryClause - { - public JoinIntoQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.JoinIntoClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitJoinIntoQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitJoinIntoQueryClause(this, argument); - } - } - - /// - /// Represents a join into query clause in C#. - /// - internal sealed partial class LazyJoinIntoQueryClause : LazyQueryClause, IJoinIntoQueryClause - { - public LazyJoinIntoQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.JoinIntoClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitJoinIntoQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitJoinIntoQueryClause(this, argument); - } - } - - /// - /// Represents a distinct query clause in VB. - /// - internal sealed partial class DistinctQueryClause : QueryClause, IDistinctQueryClause - { - public DistinctQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.DistinctClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitDistinctQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitDistinctQueryClause(this, argument); - } - } - - /// - /// Represents a distinct query clause in VB. - /// - internal sealed partial class LazyDistinctQueryClause : LazyQueryClause, IDistinctQueryClause - { - public LazyDistinctQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.DistinctClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitDistinctQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitDistinctQueryClause(this, argument); - } - } - - /// - /// Represents an aggregate query clause in VB. - /// - internal sealed partial class AggregateQueryClause : QueryClause, IAggregateQueryClause - { - public AggregateQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.AggregateClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitAggregateQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitAggregateQueryClause(this, argument); - } - } - - /// - /// Represents an aggregate query clause in VB. - /// - internal sealed partial class LazyAggregateQueryClause : LazyQueryClause, IAggregateQueryClause - { - public LazyAggregateQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.AggregateClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitAggregateQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitAggregateQueryClause(this, argument); - } - } - - /// - /// Represents a skip query clause in VB. - /// - internal sealed partial class SkipQueryClause : QueryClause, ISkipQueryClause - { - public SkipQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.SkipClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitSkipQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitSkipQueryClause(this, argument); - } - } - - /// - /// Represents a skip query clause in VB. - /// - internal sealed partial class LazySkipQueryClause : LazyQueryClause, ISkipQueryClause - { - public LazySkipQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.SkipClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitSkipQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitSkipQueryClause(this, argument); - } - } - - /// - /// Represents a skip while query clause in VB. - /// - internal sealed partial class SkipWhileQueryClause : QueryClause, ISkipWhileQueryClause - { - public SkipWhileQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.SkipWhileClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitSkipWhileQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitSkipWhileQueryClause(this, argument); - } - } - - /// - /// Represents a skip while query clause in VB. - /// - internal sealed partial class LazySkipWhileQueryClause : LazyQueryClause, ISkipWhileQueryClause - { - public LazySkipWhileQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.SkipWhileClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitSkipWhileQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitSkipWhileQueryClause(this, argument); - } - } - - /// - /// Represents a take query clause in VB. - /// - internal sealed partial class TakeQueryClause : QueryClause, ITakeQueryClause - { - public TakeQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.TakeClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitTakeQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitTakeQueryClause(this, argument); - } - } - - /// - /// Represents a take query clause in VB. - /// - internal sealed partial class LazyTakeQueryClause : LazyQueryClause, ITakeQueryClause - { - public LazyTakeQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.TakeClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitTakeQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitTakeQueryClause(this, argument); - } - } - - /// - /// Represents a take while query clause in VB. - /// - internal sealed partial class TakeWhileQueryClause : QueryClause, ITakeWhileQueryClause - { - public TakeWhileQueryClause(IOperation reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.TakeWhileClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitTakeWhileQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitTakeWhileQueryClause(this, argument); - } - } - - /// - /// Represents a take while query clause in VB. - /// - internal sealed partial class LazyTakeWhileQueryClause : LazyQueryClause, ITakeWhileQueryClause - { - public LazyTakeWhileQueryClause(Lazy reducedExpression, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional constantValue) : - base(reducedExpression, QueryClauseKind.TakeWhileClause, semanticModel, syntax, type, constantValue) - { - } - public override void Accept(OperationVisitor visitor) - { - visitor.VisitTakeWhileQueryClause(this); - } - public override TResult Accept(OperationVisitor visitor, TArgument argument) - { - return visitor.VisitTakeWhileQueryClause(this, argument); - } + protected override IOperation ExpressionImpl => _lazyExpression.Value; } } diff --git a/src/Compilers/Core/Portable/Operations/Queries/IOrderExpression.cs b/src/Compilers/Core/Portable/Operations/ITranslatedQueryExpression.cs similarity index 52% rename from src/Compilers/Core/Portable/Operations/Queries/IOrderExpression.cs rename to src/Compilers/Core/Portable/Operations/ITranslatedQueryExpression.cs index df9fa784418e2..2add06935a3e4 100644 --- a/src/Compilers/Core/Portable/Operations/Queries/IOrderExpression.cs +++ b/src/Compilers/Core/Portable/Operations/ITranslatedQueryExpression.cs @@ -3,20 +3,18 @@ namespace Microsoft.CodeAnalysis.Semantics { /// - /// Represents an ordering expression within an in C# or VB. + /// Represents an unrolled/lowered query expression in C# and VB. + /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, + /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. /// /// /// This interface is reserved for implementation by its associated APIs. We reserve the right to /// change it in the future. /// - public interface IOrderingExpression : IOperation + public interface ITranslatedQueryExpression : IOperation { /// - /// for the ordering expression. - /// - OrderKind OrderKind { get; } - /// - /// Underlying ordering expression for the order by query clause. + /// Underlying unrolled expression. /// IOperation Expression { get; } } diff --git a/src/Compilers/Core/Portable/Operations/OperationCloner.cs b/src/Compilers/Core/Portable/Operations/OperationCloner.cs index cbe2287164633..e57b0c5635c4d 100644 --- a/src/Compilers/Core/Portable/Operations/OperationCloner.cs +++ b/src/Compilers/Core/Portable/Operations/OperationCloner.cs @@ -469,99 +469,9 @@ public override IOperation VisitTupleExpression(ITupleExpression operation, obje return new TupleExpression(VisitArray(operation.Elements), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); } - public override IOperation VisitAggregateQueryClause(IAggregateQueryClause operation, object argument) + public override IOperation VisitTranslatedQueryExpression(ITranslatedQueryExpression operation, object argument) { - return new AggregateQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitAggregationExpression(IAggregationExpression operation, object argument) - { - return new AggregationExpression(Visit(operation.Expression), operation.IsGroupAggregation, ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitDistinctQueryClause(IDistinctQueryClause operation, object argument) - { - return new DistinctQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitFromQueryClause(IFromQueryClause operation, object argument) - { - return new FromQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitGroupByQueryClause(IGroupByQueryClause operation, object argument) - { - return new GroupByQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitGroupJoinQueryClause(IGroupJoinQueryClause operation, object argument) - { - return new GroupJoinQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitJoinIntoQueryClause(IJoinIntoQueryClause operation, object argument) - { - return new JoinIntoQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitJoinQueryClause(IJoinQueryClause operation, object argument) - { - return new JoinQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitLetQueryClause(ILetQueryClause operation, object argument) - { - return new LetQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitOrderByQueryClause(IOrderByQueryClause operation, object argument) - { - return new OrderByQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitSelectQueryClause(ISelectQueryClause operation, object argument) - { - return new SelectQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitSkipQueryClause(ISkipQueryClause operation, object argument) - { - return new SkipQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitSkipWhileQueryClause(ISkipWhileQueryClause operation, object argument) - { - return new SkipWhileQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitTakeQueryClause(ITakeQueryClause operation, object argument) - { - return new TakeQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitTakeWhileQueryClause(ITakeWhileQueryClause operation, object argument) - { - return new TakeWhileQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitWhereQueryClause(IWhereQueryClause operation, object argument) - { - return new WhereQueryClause(Visit(operation.ReducedExpression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitOrderingExpression(IOrderingExpression operation, object argument) - { - return new OrderingExpression(Visit(operation.Expression), operation.OrderKind, ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitQueryContinuation(IQueryContinuation operation, object argument) - { - return new QueryContinuation(Visit(operation.QueryBody), operation.DeclaredSymbol, ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); - } - - public override IOperation VisitQueryExpression(IQueryExpression operation, object argument) - { - return new QueryExpression(Visit(operation.LastClauseOrContinuation), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); + return new TranslatedQueryExpression(Visit(operation.Expression), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue); } } } diff --git a/src/Compilers/Core/Portable/Operations/OperationKind.cs b/src/Compilers/Core/Portable/Operations/OperationKind.cs index fe5268eb62fb3..7ffe68daaeea6 100644 --- a/src/Compilers/Core/Portable/Operations/OperationKind.cs +++ b/src/Compilers/Core/Portable/Operations/OperationKind.cs @@ -142,10 +142,8 @@ public enum OperationKind DynamicObjectCreationExpression = 0x125, /// Indicates an . DynamicMemberReferenceExpression = 0x126, - /// Indicates an . - QueryExpression = 0x127, - /// Indicates an in an . - OrderingExpression = 0x128, + /// Indicates an . + TranslatedQueryExpression = 0x129, // Expressions that occur only in C#. @@ -170,8 +168,7 @@ public enum OperationKind /// Indicates an . OmittedArgumentExpression = 0x300, - /// Indicates an . - AggregationExpression = 0x301, + // Unused 0x301 /// Indicates an . PlaceholderExpression = 0x302, @@ -221,10 +218,5 @@ public enum OperationKind /// Indicates an . DefaultCaseClause = 0x412, - - /// Indicates an . - QueryClause = 0x413, - /// Indicates an . - QueryContinuation = 0x414, } } diff --git a/src/Compilers/Core/Portable/Operations/OperationVisitor.cs b/src/Compilers/Core/Portable/Operations/OperationVisitor.cs index 8fdd04e10416a..1a61dbb360461 100644 --- a/src/Compilers/Core/Portable/Operations/OperationVisitor.cs +++ b/src/Compilers/Core/Portable/Operations/OperationVisitor.cs @@ -465,97 +465,7 @@ public virtual void VisitTupleExpression(ITupleExpression operation) DefaultVisit(operation); } - public virtual void VisitQueryExpression(IQueryExpression operation) - { - DefaultVisit(operation); - } - - public virtual void VisitOrderingExpression(IOrderingExpression operation) - { - DefaultVisit(operation); - } - - public virtual void VisitAggregationExpression(IAggregationExpression operation) - { - DefaultVisit(operation); - } - - public virtual void VisitQueryContinuation(IQueryContinuation operation) - { - DefaultVisit(operation); - } - - public virtual void VisitFromQueryClause(IFromQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitSelectQueryClause(ISelectQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitWhereQueryClause(IWhereQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitLetQueryClause(ILetQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitOrderByQueryClause(IOrderByQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitGroupByQueryClause(IGroupByQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitGroupJoinQueryClause(IGroupJoinQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitJoinQueryClause(IJoinQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitJoinIntoQueryClause(IJoinIntoQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitDistinctQueryClause(IDistinctQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitAggregateQueryClause(IAggregateQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitSkipQueryClause(ISkipQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitSkipWhileQueryClause(ISkipWhileQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitTakeQueryClause(ITakeQueryClause operation) - { - DefaultVisit(operation); - } - - public virtual void VisitTakeWhileQueryClause(ITakeWhileQueryClause operation) + public virtual void VisitTranslatedQueryExpression(ITranslatedQueryExpression operation) { DefaultVisit(operation); } @@ -1030,97 +940,7 @@ public virtual TResult VisitTupleExpression(ITupleExpression operation, TArgumen return DefaultVisit(operation, argument); } - public virtual TResult VisitQueryExpression(IQueryExpression operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitOrderingExpression(IOrderingExpression operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitAggregationExpression(IAggregationExpression operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitQueryContinuation(IQueryContinuation operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitFromQueryClause(IFromQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitSelectQueryClause(ISelectQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitWhereQueryClause(IWhereQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitLetQueryClause(ILetQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitOrderByQueryClause(IOrderByQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitGroupByQueryClause(IGroupByQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitGroupJoinQueryClause(IGroupJoinQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitJoinQueryClause(IJoinQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitJoinIntoQueryClause(IJoinIntoQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitDistinctQueryClause(IDistinctQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitAggregateQueryClause(IAggregateQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitSkipQueryClause(ISkipQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitSkipWhileQueryClause(ISkipWhileQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitTakeQueryClause(ITakeQueryClause operation, TArgument argument) - { - return DefaultVisit(operation, argument); - } - - public virtual TResult VisitTakeWhileQueryClause(ITakeWhileQueryClause operation, TArgument argument) + public virtual TResult VisitTranslatedQueryExpression(ITranslatedQueryExpression operation, TArgument argument) { return DefaultVisit(operation, argument); } diff --git a/src/Compilers/Core/Portable/Operations/Queries/IAggregateQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IAggregateQueryClause.cs deleted file mode 100644 index 9d4ad2aec2067..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IAggregateQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents an aggregate query clause in VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IAggregateQueryClause : IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IAggregationExpression.cs b/src/Compilers/Core/Portable/Operations/Queries/IAggregationExpression.cs deleted file mode 100644 index df85928d531b9..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IAggregationExpression.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a group or function aggregation expression inside an Into clause of a Group By or Aggregate query clause in VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IAggregationExpression : IOperation - { - /// - /// Flag indicating if this is a group aggregation clause. - /// - bool IsGroupAggregation { get; } - - /// - /// Aggregation expression. - /// - IOperation Expression { get; } - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IDistinctQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IDistinctQueryClause.cs deleted file mode 100644 index b8ec55b4652d3..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IDistinctQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a distinct query clause in VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IDistinctQueryClause : IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IFromQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IFromQueryClause.cs deleted file mode 100644 index 33a0bee240635..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IFromQueryClause.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Immutable; - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a from query clause in C# or VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IFromQueryClause: IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IGroupByQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IGroupByQueryClause.cs deleted file mode 100644 index 3650dab94179a..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IGroupByQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a group by query clause in C# or VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IGroupByQueryClause: IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IGroupJoinQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IGroupJoinQueryClause.cs deleted file mode 100644 index 9d847b62069e9..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IGroupJoinQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a group join query clause in VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IGroupJoinQueryClause : IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IJoinIntoQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IJoinIntoQueryClause.cs deleted file mode 100644 index d3d5f749e8410..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IJoinIntoQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a join into query clause in C#. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IJoinIntoQueryClause : IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IJoinQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IJoinQueryClause.cs deleted file mode 100644 index 1fb08e899da46..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IJoinQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a join query clause in C# or VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IJoinQueryClause : IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/ILetQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/ILetQueryClause.cs deleted file mode 100644 index 8647b77ee4ba0..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/ILetQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a let query clause in C# or VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface ILetQueryClause : IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IOrderByQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IOrderByQueryClause.cs deleted file mode 100644 index 7e9f2fa48df33..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IOrderByQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents an order by query clause in C# or VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IOrderByQueryClause: IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IQueryClause.cs deleted file mode 100644 index e5ef6c23644a0..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IQueryClause.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a query clause in C# or VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IQueryClause : IOperation - { - /// - /// of the clause. - /// - QueryClauseKind ClauseKind { get; } - - /// - /// Underlying reduced expression for the query clause. This is normally the invocation expression for the underlying linq call. - /// - IOperation ReducedExpression { get; } - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IQueryContinuation.cs b/src/Compilers/Core/Portable/Operations/Queries/IQueryContinuation.cs deleted file mode 100644 index d2f8da311bf52..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IQueryContinuation.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a query continuation in C#. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IQueryContinuation : IOperation - { - /// - /// Declared symbol. - /// - IRangeVariableSymbol DeclaredSymbol { get; } - - /// - /// Query body of the continuation. - /// - IOperation QueryBody { get; } - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IQueryExpression.cs b/src/Compilers/Core/Portable/Operations/Queries/IQueryExpression.cs deleted file mode 100644 index 630afb0288425..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IQueryExpression.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a query expression in C# or VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IQueryExpression : IOperation - { - /// - /// Last or in the unrolled query expression. - /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, - /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. - /// - IOperation LastClauseOrContinuation { get; } - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/ISelectQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/ISelectQueryClause.cs deleted file mode 100644 index 65187b4e4911d..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/ISelectQueryClause.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Immutable; - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a select query clause in C# or VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface ISelectQueryClause: IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/ISkipQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/ISkipQueryClause.cs deleted file mode 100644 index 4a4c49b9f3603..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/ISkipQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a skip query clause in VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface ISkipQueryClause : IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/ISkipWhileQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/ISkipWhileQueryClause.cs deleted file mode 100644 index 3e414094122e7..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/ISkipWhileQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a skip while query clause in VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface ISkipWhileQueryClause : IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/ITakeQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/ITakeQueryClause.cs deleted file mode 100644 index 2aafb7745167e..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/ITakeQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a take query clause in VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface ITakeQueryClause : IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/ITakeWhileQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/ITakeWhileQueryClause.cs deleted file mode 100644 index 8291c56628b3e..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/ITakeWhileQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a take while query clause in VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface ITakeWhileQueryClause : IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/IWhereQueryClause.cs b/src/Compilers/Core/Portable/Operations/Queries/IWhereQueryClause.cs deleted file mode 100644 index 0d9053ac002a0..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/IWhereQueryClause.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Represents a where query clause in C# or VB. - /// - /// - /// This interface is reserved for implementation by its associated APIs. We reserve the right to - /// change it in the future. - /// - public interface IWhereQueryClause: IQueryClause - { - } -} diff --git a/src/Compilers/Core/Portable/Operations/Queries/OrderKind.cs b/src/Compilers/Core/Portable/Operations/Queries/OrderKind.cs deleted file mode 100644 index 743a3966dbced..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/OrderKind.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Kind of ordering for an - /// - public enum OrderKind - { - /// - /// Represents no ordering for an . - /// - None = 0x0, - - /// - /// Represents an ascending ordering for an . - /// - Ascending = 0x1, - - /// - /// Represents an ascending ordering for an . - /// - Descending = 0x2, - } -} - diff --git a/src/Compilers/Core/Portable/Operations/Queries/QueryClauseKind.cs b/src/Compilers/Core/Portable/Operations/Queries/QueryClauseKind.cs deleted file mode 100644 index 1b9f7b2d342ee..0000000000000 --- a/src/Compilers/Core/Portable/Operations/Queries/QueryClauseKind.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Semantics -{ - /// - /// Kind of within an . - /// - public enum QueryClauseKind - { - /// Indicates an invalid clause kind. - None = 0x00, - /// Indicates an in C# and VB. - FromClause = 0x01, - /// Indicates an in C# and VB. - SelectClause = 0x02, - /// Indicates an in C# and VB. - WhereClause = 0x03, - /// Indicates an in C# and VB. - LetClause = 0x04, - /// Indicates an in C# and VB. - OrderByClause = 0x05, - /// Indicates an in C# and VB. - GroupByClause = 0x06, - /// Indicates an in VB. - GroupJoinClause = 0x07, - /// Indicates an in C# and VB. - JoinClause = 0x08, - /// Indicates an in C#. - JoinIntoClause = 0x09, - /// Indicates an in VB. - DistinctClause = 0x0a, - /// Indicates an in VB. - AggregateClause = 0x0b, - /// Indicates an in VB. - SkipClause = 0x0c, - /// Indicates an in VB. - SkipWhileClause = 0x0d, - /// Indicates an in VB. - TakeClause = 0x0e, - /// Indicates an in VB. - TakeWhileClause = 0x0f, - } -} - diff --git a/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt b/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt index 578465b4f545d..b5bdd995ede97 100644 --- a/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt +++ b/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt @@ -1,7 +1,6 @@ *REMOVED*Microsoft.CodeAnalysis.Compilation.Emit(System.IO.Stream peStream, System.IO.Stream pdbStream = null, System.IO.Stream xmlDocumentationStream = null, System.IO.Stream win32Resources = null, System.Collections.Generic.IEnumerable manifestResources = null, Microsoft.CodeAnalysis.Emit.EmitOptions options = null, Microsoft.CodeAnalysis.IMethodSymbol debugEntryPoint = null, System.IO.Stream sourceLinkStream = null, System.Collections.Generic.IEnumerable embeddedTexts = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.Emit.EmitResult *REMOVED*Microsoft.CodeAnalysis.Emit.EmitOptions.EmitOptions(bool metadataOnly = false, Microsoft.CodeAnalysis.Emit.DebugInformationFormat debugInformationFormat = (Microsoft.CodeAnalysis.Emit.DebugInformationFormat)0, string pdbFilePath = null, string outputNameOverride = null, int fileAlignment = 0, ulong baseAddress = 0, bool highEntropyVirtualAddressSpace = false, Microsoft.CodeAnalysis.SubsystemVersion subsystemVersion = default(Microsoft.CodeAnalysis.SubsystemVersion), string runtimeMetadataVersion = null, bool tolerateErrors = false, bool includePrivateMembers = false, System.Collections.Immutable.ImmutableArray instrumentationKinds = default(System.Collections.Immutable.ImmutableArray)) -> void *REMOVED*Microsoft.CodeAnalysis.IOperation.IsInvalid.get -> bool -abstract Microsoft.CodeAnalysis.SemanticModel.RootCore.get -> Microsoft.CodeAnalysis.SyntaxNode Microsoft.CodeAnalysis.CommandLineArguments.DisplayLangVersions.get -> bool Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.RegisterOperationAction(System.Action action, params Microsoft.CodeAnalysis.OperationKind[] operationKinds) -> void Microsoft.CodeAnalysis.Diagnostics.CompilationStartAnalysisContext.RegisterOperationAction(System.Action action, params Microsoft.CodeAnalysis.OperationKind[] operationKinds) -> void @@ -44,12 +43,11 @@ Microsoft.CodeAnalysis.IOperation.Children.get -> System.Collections.Generic.IEn Microsoft.CodeAnalysis.IOperation.ConstantValue.get -> Microsoft.CodeAnalysis.Optional Microsoft.CodeAnalysis.IOperation.Kind.get -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.IOperation.Language.get -> string +Microsoft.CodeAnalysis.IOperation.Parent.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.IOperation.Syntax.get -> Microsoft.CodeAnalysis.SyntaxNode Microsoft.CodeAnalysis.IOperation.Type.get -> Microsoft.CodeAnalysis.ITypeSymbol -Microsoft.CodeAnalysis.IOperation.Parent.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.AddressOfExpression = 515 -> Microsoft.CodeAnalysis.OperationKind -Microsoft.CodeAnalysis.OperationKind.AggregationExpression = 769 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.AnonymousObjectCreationExpression = 287 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.Argument = 1031 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ArrayCreationExpression = 276 -> Microsoft.CodeAnalysis.OperationKind @@ -106,7 +104,6 @@ Microsoft.CodeAnalysis.OperationKind.NullCoalescingExpression = 272 -> Microsoft Microsoft.CodeAnalysis.OperationKind.ObjectCreationExpression = 274 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ObjectOrCollectionInitializerExpression = 288 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.OmittedArgumentExpression = 768 -> Microsoft.CodeAnalysis.OperationKind -Microsoft.CodeAnalysis.OperationKind.OrderingExpression = 296 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ParameterInitializer = 1028 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ParameterReferenceExpression = 262 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ParenthesizedExpression = 282 -> Microsoft.CodeAnalysis.OperationKind @@ -115,9 +112,6 @@ Microsoft.CodeAnalysis.OperationKind.PlaceholderExpression = 770 -> Microsoft.Co Microsoft.CodeAnalysis.OperationKind.PointerIndirectionReferenceExpression = 516 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.PropertyInitializer = 1027 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.PropertyReferenceExpression = 266 -> Microsoft.CodeAnalysis.OperationKind -Microsoft.CodeAnalysis.OperationKind.QueryClause = 1043 -> Microsoft.CodeAnalysis.OperationKind -Microsoft.CodeAnalysis.OperationKind.QueryContinuation = 1044 -> Microsoft.CodeAnalysis.OperationKind -Microsoft.CodeAnalysis.OperationKind.QueryExpression = 295 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.RangeCaseClause = 1036 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.RelationalCaseClause = 1035 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ReturnStatement = 11 -> Microsoft.CodeAnalysis.OperationKind @@ -130,6 +124,7 @@ Microsoft.CodeAnalysis.OperationKind.SwitchStatement = 4 -> Microsoft.CodeAnalys Microsoft.CodeAnalysis.OperationKind.SyntheticLocalReferenceExpression = 263 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ThrowExpression = 519 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.ThrowStatement = 10 -> Microsoft.CodeAnalysis.OperationKind +Microsoft.CodeAnalysis.OperationKind.TranslatedQueryExpression = 297 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.TryStatement = 14 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.TupleExpression = 292 -> Microsoft.CodeAnalysis.OperationKind Microsoft.CodeAnalysis.OperationKind.TypeOfExpression = 513 -> Microsoft.CodeAnalysis.OperationKind @@ -346,10 +341,6 @@ Microsoft.CodeAnalysis.Semantics.ConversionKind.OperatorMethod = 5 -> Microsoft. Microsoft.CodeAnalysis.Semantics.ConversionKind.TryCast = 2 -> Microsoft.CodeAnalysis.Semantics.ConversionKind Microsoft.CodeAnalysis.Semantics.IAddressOfExpression Microsoft.CodeAnalysis.Semantics.IAddressOfExpression.Reference.get -> Microsoft.CodeAnalysis.IOperation -Microsoft.CodeAnalysis.Semantics.IAggregateQueryClause -Microsoft.CodeAnalysis.Semantics.IAggregationExpression -Microsoft.CodeAnalysis.Semantics.IAggregationExpression.Expression.get -> Microsoft.CodeAnalysis.IOperation -Microsoft.CodeAnalysis.Semantics.IAggregationExpression.IsGroupAggregation.get -> bool Microsoft.CodeAnalysis.Semantics.IAnonymousObjectCreationExpression Microsoft.CodeAnalysis.Semantics.IAnonymousObjectCreationExpression.Initializers.get -> System.Collections.Immutable.ImmutableArray Microsoft.CodeAnalysis.Semantics.IArgument @@ -374,9 +365,9 @@ Microsoft.CodeAnalysis.Semantics.IAwaitExpression Microsoft.CodeAnalysis.Semantics.IAwaitExpression.AwaitedValue.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IBinaryOperatorExpression Microsoft.CodeAnalysis.Semantics.IBinaryOperatorExpression.BinaryOperationKind.get -> Microsoft.CodeAnalysis.Semantics.BinaryOperationKind +Microsoft.CodeAnalysis.Semantics.IBinaryOperatorExpression.IsLifted.get -> bool Microsoft.CodeAnalysis.Semantics.IBinaryOperatorExpression.LeftOperand.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IBinaryOperatorExpression.RightOperand.get -> Microsoft.CodeAnalysis.IOperation -Microsoft.CodeAnalysis.Semantics.IBinaryOperatorExpression.IsLifted.get -> bool Microsoft.CodeAnalysis.Semantics.IBlockStatement Microsoft.CodeAnalysis.Semantics.IBlockStatement.Locals.get -> System.Collections.Immutable.ImmutableArray Microsoft.CodeAnalysis.Semantics.IBlockStatement.Statements.get -> System.Collections.Immutable.ImmutableArray @@ -417,7 +408,6 @@ Microsoft.CodeAnalysis.Semantics.IDeclarationPattern Microsoft.CodeAnalysis.Semantics.IDeclarationPattern.DeclaredSymbol.get -> Microsoft.CodeAnalysis.ISymbol Microsoft.CodeAnalysis.Semantics.IDefaultCaseClause Microsoft.CodeAnalysis.Semantics.IDefaultValueExpression -Microsoft.CodeAnalysis.Semantics.IDistinctQueryClause Microsoft.CodeAnalysis.Semantics.IDynamicMemberReferenceExpression Microsoft.CodeAnalysis.Semantics.IDynamicMemberReferenceExpression.ContainingType.get -> Microsoft.CodeAnalysis.ITypeSymbol Microsoft.CodeAnalysis.Semantics.IDynamicMemberReferenceExpression.Instance.get -> Microsoft.CodeAnalysis.IOperation @@ -452,9 +442,6 @@ Microsoft.CodeAnalysis.Semantics.IForLoopStatement.Before.get -> System.Collecti Microsoft.CodeAnalysis.Semantics.IForLoopStatement.Locals.get -> System.Collections.Immutable.ImmutableArray Microsoft.CodeAnalysis.Semantics.IForWhileUntilLoopStatement Microsoft.CodeAnalysis.Semantics.IForWhileUntilLoopStatement.Condition.get -> Microsoft.CodeAnalysis.IOperation -Microsoft.CodeAnalysis.Semantics.IFromQueryClause -Microsoft.CodeAnalysis.Semantics.IGroupByQueryClause -Microsoft.CodeAnalysis.Semantics.IGroupJoinQueryClause Microsoft.CodeAnalysis.Semantics.IHasArgumentsExpression Microsoft.CodeAnalysis.Semantics.IHasArgumentsExpression.ArgumentsInEvaluationOrder.get -> System.Collections.Immutable.ImmutableArray Microsoft.CodeAnalysis.Semantics.IHasDynamicArgumentsExpression @@ -496,15 +483,12 @@ Microsoft.CodeAnalysis.Semantics.IIsPatternExpression.Pattern.get -> Microsoft.C Microsoft.CodeAnalysis.Semantics.IIsTypeExpression Microsoft.CodeAnalysis.Semantics.IIsTypeExpression.IsType.get -> Microsoft.CodeAnalysis.ITypeSymbol Microsoft.CodeAnalysis.Semantics.IIsTypeExpression.Operand.get -> Microsoft.CodeAnalysis.IOperation -Microsoft.CodeAnalysis.Semantics.IJoinIntoQueryClause -Microsoft.CodeAnalysis.Semantics.IJoinQueryClause Microsoft.CodeAnalysis.Semantics.ILabelStatement Microsoft.CodeAnalysis.Semantics.ILabelStatement.Label.get -> Microsoft.CodeAnalysis.ILabelSymbol Microsoft.CodeAnalysis.Semantics.ILabelStatement.LabeledStatement.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.ILambdaExpression Microsoft.CodeAnalysis.Semantics.ILambdaExpression.Body.get -> Microsoft.CodeAnalysis.Semantics.IBlockStatement Microsoft.CodeAnalysis.Semantics.ILambdaExpression.Signature.get -> Microsoft.CodeAnalysis.IMethodSymbol -Microsoft.CodeAnalysis.Semantics.ILetQueryClause Microsoft.CodeAnalysis.Semantics.ILiteralExpression Microsoft.CodeAnalysis.Semantics.ILiteralExpression.Text.get -> string Microsoft.CodeAnalysis.Semantics.ILocalFunctionStatement @@ -538,10 +522,6 @@ Microsoft.CodeAnalysis.Semantics.IObjectCreationExpression.Initializer.get -> Mi Microsoft.CodeAnalysis.Semantics.IObjectOrCollectionInitializerExpression Microsoft.CodeAnalysis.Semantics.IObjectOrCollectionInitializerExpression.Initializers.get -> System.Collections.Immutable.ImmutableArray Microsoft.CodeAnalysis.Semantics.IOmittedArgumentExpression -Microsoft.CodeAnalysis.Semantics.IOrderByQueryClause -Microsoft.CodeAnalysis.Semantics.IOrderingExpression -Microsoft.CodeAnalysis.Semantics.IOrderingExpression.Expression.get -> Microsoft.CodeAnalysis.IOperation -Microsoft.CodeAnalysis.Semantics.IOrderingExpression.OrderKind.get -> Microsoft.CodeAnalysis.Semantics.OrderKind Microsoft.CodeAnalysis.Semantics.IParameterInitializer Microsoft.CodeAnalysis.Semantics.IParameterInitializer.Parameter.get -> Microsoft.CodeAnalysis.IParameterSymbol Microsoft.CodeAnalysis.Semantics.IParameterReferenceExpression @@ -560,14 +540,6 @@ Microsoft.CodeAnalysis.Semantics.IPropertyInitializer Microsoft.CodeAnalysis.Semantics.IPropertyInitializer.InitializedProperty.get -> Microsoft.CodeAnalysis.IPropertySymbol Microsoft.CodeAnalysis.Semantics.IPropertyReferenceExpression Microsoft.CodeAnalysis.Semantics.IPropertyReferenceExpression.Property.get -> Microsoft.CodeAnalysis.IPropertySymbol -Microsoft.CodeAnalysis.Semantics.IQueryClause -Microsoft.CodeAnalysis.Semantics.IQueryClause.ClauseKind.get -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.IQueryClause.ReducedExpression.get -> Microsoft.CodeAnalysis.IOperation -Microsoft.CodeAnalysis.Semantics.IQueryContinuation -Microsoft.CodeAnalysis.Semantics.IQueryContinuation.DeclaredSymbol.get -> Microsoft.CodeAnalysis.IRangeVariableSymbol -Microsoft.CodeAnalysis.Semantics.IQueryContinuation.QueryBody.get -> Microsoft.CodeAnalysis.IOperation -Microsoft.CodeAnalysis.Semantics.IQueryExpression -Microsoft.CodeAnalysis.Semantics.IQueryExpression.LastClauseOrContinuation.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IRangeCaseClause Microsoft.CodeAnalysis.Semantics.IRangeCaseClause.MaximumValue.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IRangeCaseClause.MinimumValue.get -> Microsoft.CodeAnalysis.IOperation @@ -576,14 +548,11 @@ Microsoft.CodeAnalysis.Semantics.IRelationalCaseClause.Relation.get -> Microsoft Microsoft.CodeAnalysis.Semantics.IRelationalCaseClause.Value.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IReturnStatement Microsoft.CodeAnalysis.Semantics.IReturnStatement.ReturnedValue.get -> Microsoft.CodeAnalysis.IOperation -Microsoft.CodeAnalysis.Semantics.ISelectQueryClause Microsoft.CodeAnalysis.Semantics.ISimpleAssignmentExpression Microsoft.CodeAnalysis.Semantics.ISingleValueCaseClause Microsoft.CodeAnalysis.Semantics.ISingleValueCaseClause.Equality.get -> Microsoft.CodeAnalysis.Semantics.BinaryOperationKind Microsoft.CodeAnalysis.Semantics.ISingleValueCaseClause.Value.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.ISizeOfExpression -Microsoft.CodeAnalysis.Semantics.ISkipQueryClause -Microsoft.CodeAnalysis.Semantics.ISkipWhileQueryClause Microsoft.CodeAnalysis.Semantics.IStopStatement Microsoft.CodeAnalysis.Semantics.ISwitchCase Microsoft.CodeAnalysis.Semantics.ISwitchCase.Body.get -> System.Collections.Immutable.ImmutableArray @@ -595,12 +564,12 @@ Microsoft.CodeAnalysis.Semantics.ISymbolInitializer Microsoft.CodeAnalysis.Semantics.ISymbolInitializer.Value.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.ISyntheticLocalReferenceExpression Microsoft.CodeAnalysis.Semantics.ISyntheticLocalReferenceExpression.SyntheticLocalKind.get -> Microsoft.CodeAnalysis.Semantics.SyntheticLocalKind -Microsoft.CodeAnalysis.Semantics.ITakeQueryClause -Microsoft.CodeAnalysis.Semantics.ITakeWhileQueryClause Microsoft.CodeAnalysis.Semantics.IThrowExpression Microsoft.CodeAnalysis.Semantics.IThrowExpression.Expression.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IThrowStatement Microsoft.CodeAnalysis.Semantics.IThrowStatement.ThrownObject.get -> Microsoft.CodeAnalysis.IOperation +Microsoft.CodeAnalysis.Semantics.ITranslatedQueryExpression +Microsoft.CodeAnalysis.Semantics.ITranslatedQueryExpression.Expression.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.ITryStatement Microsoft.CodeAnalysis.Semantics.ITryStatement.Body.get -> Microsoft.CodeAnalysis.Semantics.IBlockStatement Microsoft.CodeAnalysis.Semantics.ITryStatement.Catches.get -> System.Collections.Immutable.ImmutableArray @@ -613,9 +582,9 @@ Microsoft.CodeAnalysis.Semantics.ITypeOperationExpression.TypeOperand.get -> Mic Microsoft.CodeAnalysis.Semantics.ITypeParameterObjectCreationExpression Microsoft.CodeAnalysis.Semantics.ITypeParameterObjectCreationExpression.Initializer.get -> Microsoft.CodeAnalysis.Semantics.IObjectOrCollectionInitializerExpression Microsoft.CodeAnalysis.Semantics.IUnaryOperatorExpression +Microsoft.CodeAnalysis.Semantics.IUnaryOperatorExpression.IsLifted.get -> bool Microsoft.CodeAnalysis.Semantics.IUnaryOperatorExpression.Operand.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IUnaryOperatorExpression.UnaryOperationKind.get -> Microsoft.CodeAnalysis.Semantics.UnaryOperationKind -Microsoft.CodeAnalysis.Semantics.IUnaryOperatorExpression.IsLifted.get -> bool Microsoft.CodeAnalysis.Semantics.IUsingStatement Microsoft.CodeAnalysis.Semantics.IUsingStatement.Body.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IUsingStatement.Declaration.get -> Microsoft.CodeAnalysis.Semantics.IVariableDeclarationStatement @@ -625,7 +594,6 @@ Microsoft.CodeAnalysis.Semantics.IVariableDeclaration.Initializer.get -> Microso Microsoft.CodeAnalysis.Semantics.IVariableDeclaration.Variables.get -> System.Collections.Immutable.ImmutableArray Microsoft.CodeAnalysis.Semantics.IVariableDeclarationStatement Microsoft.CodeAnalysis.Semantics.IVariableDeclarationStatement.Declarations.get -> System.Collections.Immutable.ImmutableArray -Microsoft.CodeAnalysis.Semantics.IWhereQueryClause Microsoft.CodeAnalysis.Semantics.IWhileUntilLoopStatement Microsoft.CodeAnalysis.Semantics.IWhileUntilLoopStatement.IsTopTest.get -> bool Microsoft.CodeAnalysis.Semantics.IWhileUntilLoopStatement.IsWhile.get -> bool @@ -650,27 +618,6 @@ Microsoft.CodeAnalysis.Semantics.OperationVisitor Microsoft.CodeAnalysis.Semantics.OperationVisitor.OperationVisitor() -> void Microsoft.CodeAnalysis.Semantics.OperationWalker Microsoft.CodeAnalysis.Semantics.OperationWalker.OperationWalker() -> void -Microsoft.CodeAnalysis.Semantics.OrderKind -Microsoft.CodeAnalysis.Semantics.OrderKind.Ascending = 1 -> Microsoft.CodeAnalysis.Semantics.OrderKind -Microsoft.CodeAnalysis.Semantics.OrderKind.Descending = 2 -> Microsoft.CodeAnalysis.Semantics.OrderKind -Microsoft.CodeAnalysis.Semantics.OrderKind.None = 0 -> Microsoft.CodeAnalysis.Semantics.OrderKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.AggregateClause = 11 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.DistinctClause = 10 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.FromClause = 1 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.GroupByClause = 6 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.GroupJoinClause = 7 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.JoinClause = 8 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.JoinIntoClause = 9 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.LetClause = 4 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.None = 0 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.OrderByClause = 5 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.SelectClause = 2 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.SkipClause = 12 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.SkipWhileClause = 13 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.TakeClause = 14 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.TakeWhileClause = 15 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind -Microsoft.CodeAnalysis.Semantics.QueryClauseKind.WhereClause = 3 -> Microsoft.CodeAnalysis.Semantics.QueryClauseKind Microsoft.CodeAnalysis.Semantics.SimpleBinaryOperationKind Microsoft.CodeAnalysis.Semantics.SimpleBinaryOperationKind.Add = 1 -> Microsoft.CodeAnalysis.Semantics.SimpleBinaryOperationKind Microsoft.CodeAnalysis.Semantics.SimpleBinaryOperationKind.And = 10 -> Microsoft.CodeAnalysis.Semantics.SimpleBinaryOperationKind @@ -802,6 +749,7 @@ Microsoft.CodeAnalysis.SyntaxTriviaList.SyntaxTriviaList(params Microsoft.CodeAn abstract Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.RegisterOperationAction(System.Action action, System.Collections.Immutable.ImmutableArray operationKinds) -> void abstract Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.RegisterOperationBlockEndAction(System.Action action) -> void abstract Microsoft.CodeAnalysis.SemanticModel.GetOperationCore(Microsoft.CodeAnalysis.SyntaxNode node, System.Threading.CancellationToken cancellationToken) -> Microsoft.CodeAnalysis.IOperation +abstract Microsoft.CodeAnalysis.SemanticModel.RootCore.get -> Microsoft.CodeAnalysis.SyntaxNode override Microsoft.CodeAnalysis.Optional.ToString() -> string override Microsoft.CodeAnalysis.Semantics.OperationWalker.DefaultVisit(Microsoft.CodeAnalysis.IOperation operation) -> void override Microsoft.CodeAnalysis.Semantics.OperationWalker.Visit(Microsoft.CodeAnalysis.IOperation operation) -> void @@ -831,8 +779,6 @@ virtual Microsoft.CodeAnalysis.Diagnostics.CompilationStartAnalysisContext.Regis virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.DefaultVisit(Microsoft.CodeAnalysis.IOperation operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Visit(Microsoft.CodeAnalysis.IOperation operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAddressOfExpression(Microsoft.CodeAnalysis.Semantics.IAddressOfExpression operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAggregateQueryClause(Microsoft.CodeAnalysis.Semantics.IAggregateQueryClause operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAggregationExpression(Microsoft.CodeAnalysis.Semantics.IAggregationExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAnonymousObjectCreationExpression(Microsoft.CodeAnalysis.Semantics.IAnonymousObjectCreationExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitArgument(Microsoft.CodeAnalysis.Semantics.IArgument operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitArrayCreationExpression(Microsoft.CodeAnalysis.Semantics.IArrayCreationExpression operation) -> void @@ -853,7 +799,6 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitConversionExpress virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDeclarationPattern(Microsoft.CodeAnalysis.Semantics.IDeclarationPattern operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDefaultCaseClause(Microsoft.CodeAnalysis.Semantics.IDefaultCaseClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDefaultValueExpression(Microsoft.CodeAnalysis.Semantics.IDefaultValueExpression operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDistinctQueryClause(Microsoft.CodeAnalysis.Semantics.IDistinctQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDynamicMemberReferenceExpression(Microsoft.CodeAnalysis.Semantics.IDynamicMemberReferenceExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDynamicObjectCreationExpression(Microsoft.CodeAnalysis.Semantics.IDynamicObjectCreationExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitEmptyStatement(Microsoft.CodeAnalysis.Semantics.IEmptyStatement operation) -> void @@ -866,9 +811,6 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitFieldReferenceExp virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitFixedStatement(Microsoft.CodeAnalysis.Semantics.IFixedStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitForEachLoopStatement(Microsoft.CodeAnalysis.Semantics.IForEachLoopStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitForLoopStatement(Microsoft.CodeAnalysis.Semantics.IForLoopStatement operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitFromQueryClause(Microsoft.CodeAnalysis.Semantics.IFromQueryClause operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitGroupByQueryClause(Microsoft.CodeAnalysis.Semantics.IGroupByQueryClause operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitGroupJoinQueryClause(Microsoft.CodeAnalysis.Semantics.IGroupJoinQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIfStatement(Microsoft.CodeAnalysis.Semantics.IIfStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIncrementExpression(Microsoft.CodeAnalysis.Semantics.IIncrementExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitInstanceReferenceExpression(Microsoft.CodeAnalysis.Semantics.IInstanceReferenceExpression operation) -> void @@ -880,11 +822,8 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitInvalidStatement( virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitInvocationExpression(Microsoft.CodeAnalysis.Semantics.IInvocationExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIsPatternExpression(Microsoft.CodeAnalysis.Semantics.IIsPatternExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIsTypeExpression(Microsoft.CodeAnalysis.Semantics.IIsTypeExpression operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitJoinIntoQueryClause(Microsoft.CodeAnalysis.Semantics.IJoinIntoQueryClause operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitJoinQueryClause(Microsoft.CodeAnalysis.Semantics.IJoinQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLabelStatement(Microsoft.CodeAnalysis.Semantics.ILabelStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLambdaExpression(Microsoft.CodeAnalysis.Semantics.ILambdaExpression operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLetQueryClause(Microsoft.CodeAnalysis.Semantics.ILetQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLiteralExpression(Microsoft.CodeAnalysis.Semantics.ILiteralExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLocalFunctionStatement(Microsoft.CodeAnalysis.Semantics.ILocalFunctionStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLocalReferenceExpression(Microsoft.CodeAnalysis.Semantics.ILocalReferenceExpression operation) -> void @@ -896,8 +835,6 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitNullCoalescingExp virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitObjectCreationExpression(Microsoft.CodeAnalysis.Semantics.IObjectCreationExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitObjectOrCollectionInitializerExpression(Microsoft.CodeAnalysis.Semantics.IObjectOrCollectionInitializerExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitOmittedArgumentExpression(Microsoft.CodeAnalysis.Semantics.IOmittedArgumentExpression operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitOrderByQueryClause(Microsoft.CodeAnalysis.Semantics.IOrderByQueryClause operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitOrderingExpression(Microsoft.CodeAnalysis.Semantics.IOrderingExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitParameterInitializer(Microsoft.CodeAnalysis.Semantics.IParameterInitializer operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitParameterReferenceExpression(Microsoft.CodeAnalysis.Semantics.IParameterReferenceExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitParenthesizedExpression(Microsoft.CodeAnalysis.Semantics.IParenthesizedExpression operation) -> void @@ -906,25 +843,19 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPlaceholderExpres virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPointerIndirectionReferenceExpression(Microsoft.CodeAnalysis.Semantics.IPointerIndirectionReferenceExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPropertyInitializer(Microsoft.CodeAnalysis.Semantics.IPropertyInitializer operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPropertyReferenceExpression(Microsoft.CodeAnalysis.Semantics.IPropertyReferenceExpression operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitQueryContinuation(Microsoft.CodeAnalysis.Semantics.IQueryContinuation operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitQueryExpression(Microsoft.CodeAnalysis.Semantics.IQueryExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitRangeCaseClause(Microsoft.CodeAnalysis.Semantics.IRangeCaseClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitRelationalCaseClause(Microsoft.CodeAnalysis.Semantics.IRelationalCaseClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitReturnStatement(Microsoft.CodeAnalysis.Semantics.IReturnStatement operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSelectQueryClause(Microsoft.CodeAnalysis.Semantics.ISelectQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSimpleAssignmentExpression(Microsoft.CodeAnalysis.Semantics.ISimpleAssignmentExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSingleValueCaseClause(Microsoft.CodeAnalysis.Semantics.ISingleValueCaseClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSizeOfExpression(Microsoft.CodeAnalysis.Semantics.ISizeOfExpression operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSkipQueryClause(Microsoft.CodeAnalysis.Semantics.ISkipQueryClause operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSkipWhileQueryClause(Microsoft.CodeAnalysis.Semantics.ISkipWhileQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitStopStatement(Microsoft.CodeAnalysis.Semantics.IStopStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSwitchCase(Microsoft.CodeAnalysis.Semantics.ISwitchCase operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSwitchStatement(Microsoft.CodeAnalysis.Semantics.ISwitchStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSyntheticLocalReferenceExpression(Microsoft.CodeAnalysis.Semantics.ISyntheticLocalReferenceExpression operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTakeQueryClause(Microsoft.CodeAnalysis.Semantics.ITakeQueryClause operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTakeWhileQueryClause(Microsoft.CodeAnalysis.Semantics.ITakeWhileQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitThrowExpression(Microsoft.CodeAnalysis.Semantics.IThrowExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitThrowStatement(Microsoft.CodeAnalysis.Semantics.IThrowStatement operation) -> void +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTranslatedQueryExpression(Microsoft.CodeAnalysis.Semantics.ITranslatedQueryExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTryStatement(Microsoft.CodeAnalysis.Semantics.ITryStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTupleExpression(Microsoft.CodeAnalysis.Semantics.ITupleExpression operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTypeOfExpression(Microsoft.CodeAnalysis.Semantics.ITypeOfExpression operation) -> void @@ -933,15 +864,12 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitUnaryOperatorExpr virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitUsingStatement(Microsoft.CodeAnalysis.Semantics.IUsingStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitVariableDeclaration(Microsoft.CodeAnalysis.Semantics.IVariableDeclaration operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitVariableDeclarationStatement(Microsoft.CodeAnalysis.Semantics.IVariableDeclarationStatement operation) -> void -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitWhereQueryClause(Microsoft.CodeAnalysis.Semantics.IWhereQueryClause operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitWhileUntilLoopStatement(Microsoft.CodeAnalysis.Semantics.IWhileUntilLoopStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitWithStatement(Microsoft.CodeAnalysis.Semantics.IWithStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitYieldBreakStatement(Microsoft.CodeAnalysis.Semantics.IReturnStatement operation) -> void virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.DefaultVisit(Microsoft.CodeAnalysis.IOperation operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Visit(Microsoft.CodeAnalysis.IOperation operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAddressOfExpression(Microsoft.CodeAnalysis.Semantics.IAddressOfExpression operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAggregateQueryClause(Microsoft.CodeAnalysis.Semantics.IAggregateQueryClause operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAggregationExpression(Microsoft.CodeAnalysis.Semantics.IAggregationExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitAnonymousObjectCreationExpression(Microsoft.CodeAnalysis.Semantics.IAnonymousObjectCreationExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitArgument(Microsoft.CodeAnalysis.Semantics.IArgument operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitArrayCreationExpression(Microsoft.CodeAnalysis.Semantics.IArrayCreationExpression operation, TArgument argument) -> TResult @@ -962,7 +890,6 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Vi virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDeclarationPattern(Microsoft.CodeAnalysis.Semantics.IDeclarationPattern operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDefaultCaseClause(Microsoft.CodeAnalysis.Semantics.IDefaultCaseClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDefaultValueExpression(Microsoft.CodeAnalysis.Semantics.IDefaultValueExpression operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDistinctQueryClause(Microsoft.CodeAnalysis.Semantics.IDistinctQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDynamicMemberReferenceExpression(Microsoft.CodeAnalysis.Semantics.IDynamicMemberReferenceExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitDynamicObjectCreationExpression(Microsoft.CodeAnalysis.Semantics.IDynamicObjectCreationExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitEmptyStatement(Microsoft.CodeAnalysis.Semantics.IEmptyStatement operation, TArgument argument) -> TResult @@ -975,9 +902,6 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Vi virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitFixedStatement(Microsoft.CodeAnalysis.Semantics.IFixedStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitForEachLoopStatement(Microsoft.CodeAnalysis.Semantics.IForEachLoopStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitForLoopStatement(Microsoft.CodeAnalysis.Semantics.IForLoopStatement operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitFromQueryClause(Microsoft.CodeAnalysis.Semantics.IFromQueryClause operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitGroupByQueryClause(Microsoft.CodeAnalysis.Semantics.IGroupByQueryClause operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitGroupJoinQueryClause(Microsoft.CodeAnalysis.Semantics.IGroupJoinQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIfStatement(Microsoft.CodeAnalysis.Semantics.IIfStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIncrementExpression(Microsoft.CodeAnalysis.Semantics.IIncrementExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitInstanceReferenceExpression(Microsoft.CodeAnalysis.Semantics.IInstanceReferenceExpression operation, TArgument argument) -> TResult @@ -989,11 +913,8 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Vi virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitInvocationExpression(Microsoft.CodeAnalysis.Semantics.IInvocationExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIsPatternExpression(Microsoft.CodeAnalysis.Semantics.IIsPatternExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIsTypeExpression(Microsoft.CodeAnalysis.Semantics.IIsTypeExpression operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitJoinIntoQueryClause(Microsoft.CodeAnalysis.Semantics.IJoinIntoQueryClause operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitJoinQueryClause(Microsoft.CodeAnalysis.Semantics.IJoinQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLabelStatement(Microsoft.CodeAnalysis.Semantics.ILabelStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLambdaExpression(Microsoft.CodeAnalysis.Semantics.ILambdaExpression operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLetQueryClause(Microsoft.CodeAnalysis.Semantics.ILetQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLiteralExpression(Microsoft.CodeAnalysis.Semantics.ILiteralExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLocalFunctionStatement(Microsoft.CodeAnalysis.Semantics.ILocalFunctionStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLocalReferenceExpression(Microsoft.CodeAnalysis.Semantics.ILocalReferenceExpression operation, TArgument argument) -> TResult @@ -1005,8 +926,6 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Vi virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitObjectCreationExpression(Microsoft.CodeAnalysis.Semantics.IObjectCreationExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitObjectOrCollectionInitializerExpression(Microsoft.CodeAnalysis.Semantics.IObjectOrCollectionInitializerExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitOmittedArgumentExpression(Microsoft.CodeAnalysis.Semantics.IOmittedArgumentExpression operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitOrderByQueryClause(Microsoft.CodeAnalysis.Semantics.IOrderByQueryClause operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitOrderingExpression(Microsoft.CodeAnalysis.Semantics.IOrderingExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitParameterInitializer(Microsoft.CodeAnalysis.Semantics.IParameterInitializer operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitParameterReferenceExpression(Microsoft.CodeAnalysis.Semantics.IParameterReferenceExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitParenthesizedExpression(Microsoft.CodeAnalysis.Semantics.IParenthesizedExpression operation, TArgument argument) -> TResult @@ -1015,25 +934,19 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Vi virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPointerIndirectionReferenceExpression(Microsoft.CodeAnalysis.Semantics.IPointerIndirectionReferenceExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPropertyInitializer(Microsoft.CodeAnalysis.Semantics.IPropertyInitializer operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitPropertyReferenceExpression(Microsoft.CodeAnalysis.Semantics.IPropertyReferenceExpression operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitQueryContinuation(Microsoft.CodeAnalysis.Semantics.IQueryContinuation operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitQueryExpression(Microsoft.CodeAnalysis.Semantics.IQueryExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitRangeCaseClause(Microsoft.CodeAnalysis.Semantics.IRangeCaseClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitRelationalCaseClause(Microsoft.CodeAnalysis.Semantics.IRelationalCaseClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitReturnStatement(Microsoft.CodeAnalysis.Semantics.IReturnStatement operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSelectQueryClause(Microsoft.CodeAnalysis.Semantics.ISelectQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSimpleAssignmentExpression(Microsoft.CodeAnalysis.Semantics.ISimpleAssignmentExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSingleValueCaseClause(Microsoft.CodeAnalysis.Semantics.ISingleValueCaseClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSizeOfExpression(Microsoft.CodeAnalysis.Semantics.ISizeOfExpression operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSkipQueryClause(Microsoft.CodeAnalysis.Semantics.ISkipQueryClause operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSkipWhileQueryClause(Microsoft.CodeAnalysis.Semantics.ISkipWhileQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitStopStatement(Microsoft.CodeAnalysis.Semantics.IStopStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSwitchCase(Microsoft.CodeAnalysis.Semantics.ISwitchCase operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSwitchStatement(Microsoft.CodeAnalysis.Semantics.ISwitchStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitSyntheticLocalReferenceExpression(Microsoft.CodeAnalysis.Semantics.ISyntheticLocalReferenceExpression operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTakeQueryClause(Microsoft.CodeAnalysis.Semantics.ITakeQueryClause operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTakeWhileQueryClause(Microsoft.CodeAnalysis.Semantics.ITakeWhileQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitThrowExpression(Microsoft.CodeAnalysis.Semantics.IThrowExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitThrowStatement(Microsoft.CodeAnalysis.Semantics.IThrowStatement operation, TArgument argument) -> TResult +virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTranslatedQueryExpression(Microsoft.CodeAnalysis.Semantics.ITranslatedQueryExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTryStatement(Microsoft.CodeAnalysis.Semantics.ITryStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTupleExpression(Microsoft.CodeAnalysis.Semantics.ITupleExpression operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitTypeOfExpression(Microsoft.CodeAnalysis.Semantics.ITypeOfExpression operation, TArgument argument) -> TResult @@ -1042,7 +955,6 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.Vi virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitUsingStatement(Microsoft.CodeAnalysis.Semantics.IUsingStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitVariableDeclaration(Microsoft.CodeAnalysis.Semantics.IVariableDeclaration operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitVariableDeclarationStatement(Microsoft.CodeAnalysis.Semantics.IVariableDeclarationStatement operation, TArgument argument) -> TResult -virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitWhereQueryClause(Microsoft.CodeAnalysis.Semantics.IWhereQueryClause operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitWhileUntilLoopStatement(Microsoft.CodeAnalysis.Semantics.IWhileUntilLoopStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitWithStatement(Microsoft.CodeAnalysis.Semantics.IWithStatement operation, TArgument argument) -> TResult virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitYieldBreakStatement(Microsoft.CodeAnalysis.Semantics.IReturnStatement operation, TArgument argument) -> TResult diff --git a/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb b/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb index b9128aa178370..e7ec42031faf9 100644 --- a/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb +++ b/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb @@ -40,11 +40,40 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Dim originalMethodOrLambda = Me._currentMethodOrLambda Me._currentMethodOrLambda = node.LambdaSymbol + PopulateRangeVariableMapForQueryLambdaRewrite(node, _rangeVariableMap, _inExpressionLambda) + + Dim save_createSequencePointsForTopLevelNonCompilerGeneratedExpressions = _instrumentTopLevelNonCompilerGeneratedExpressionsInQuery + Dim synthesizedKind As SynthesizedLambdaKind = node.LambdaSymbol.SynthesizedKind + Dim instrumentQueryLambdaBody As Boolean = synthesizedKind = SynthesizedLambdaKind.AggregateQueryLambda OrElse + synthesizedKind = SynthesizedLambdaKind.LetVariableQueryLambda + + _instrumentTopLevelNonCompilerGeneratedExpressionsInQuery = Not instrumentQueryLambdaBody + + Dim returnstmt = RewriteQueryLambdaBody(AddressOf VisitExpressionNode, node, _rangeVariableMap, _instrumenterOpt, instrumentQueryLambdaBody:=instrumentQueryLambdaBody AndAlso Instrument) + + _instrumentTopLevelNonCompilerGeneratedExpressionsInQuery = save_createSequencePointsForTopLevelNonCompilerGeneratedExpressions + + Me._hasLambdas = True + + Dim result As BoundLambda = RewriteQueryLambda(returnstmt, node) + + ' Done with lambda body rewrite, restore current lambda. + ' END LAMBDA REWRITE + Me._currentMethodOrLambda = originalMethodOrLambda + + Return result + End Function + + Friend Shared Sub PopulateRangeVariableMapForQueryLambdaRewrite( + node As BoundQueryLambda, + ByRef rangeVariableMap As Dictionary(Of RangeVariableSymbol, BoundExpression), + inExpressionLambda As Boolean) + Dim nodeRangeVariables As ImmutableArray(Of RangeVariableSymbol) = node.RangeVariables If nodeRangeVariables.Length > 0 Then - If _rangeVariableMap Is Nothing Then - _rangeVariableMap = New Dictionary(Of RangeVariableSymbol, BoundExpression)() + If rangeVariableMap Is Nothing Then + rangeVariableMap = New Dictionary(Of RangeVariableSymbol, BoundExpression)() End If Dim firstUnmappedRangeVariable As Integer = 0 @@ -61,81 +90,39 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Dim paramRef As New BoundParameter(node.Syntax, parameter, False, - parameter.Type) + parameter.Type, + hasErrors:=parameter.Type.IsErrorType()) - If isReservedName AndAlso Not String.Equals(parameterName, StringConstants.Group, StringComparison.Ordinal) Then + If Not paramRef.HasErrors AndAlso isReservedName AndAlso Not String.Equals(parameterName, StringConstants.Group, StringComparison.Ordinal) Then ' Compound variable. ' Each range variable is an Anonymous Type property. Debug.Assert(parameterName.Equals(StringConstants.It) OrElse parameterName.Equals(StringConstants.It1) OrElse parameterName.Equals(StringConstants.It2)) - PopulateRangeVariableMapForAnonymousType(node.Syntax, paramRef, nodeRangeVariables, firstUnmappedRangeVariable) + PopulateRangeVariableMapForAnonymousType(node.Syntax, paramRef, nodeRangeVariables, firstUnmappedRangeVariable, rangeVariableMap, inExpressionLambda) Else ' Simple case, range variable is a lambda parameter. Debug.Assert(IdentifierComparison.Equals(parameterName, nodeRangeVariables(firstUnmappedRangeVariable).Name)) - _rangeVariableMap.Add(nodeRangeVariables(firstUnmappedRangeVariable), paramRef) + rangeVariableMap.Add(nodeRangeVariables(firstUnmappedRangeVariable), paramRef) firstUnmappedRangeVariable += 1 End If Next Debug.Assert(firstUnmappedRangeVariable = nodeRangeVariables.Length) End If + End Sub - Dim save_createSequencePointsForTopLevelNonCompilerGeneratedExpressions = _instrumentTopLevelNonCompilerGeneratedExpressionsInQuery - Dim synthesizedKind As SynthesizedLambdaKind = node.LambdaSymbol.SynthesizedKind - Dim instrumentQueryLambdaBody As Boolean = synthesizedKind = SynthesizedLambdaKind.AggregateQueryLambda OrElse - synthesizedKind = SynthesizedLambdaKind.LetVariableQueryLambda - - _instrumentTopLevelNonCompilerGeneratedExpressionsInQuery = Not instrumentQueryLambdaBody - - Dim returnstmt As BoundStatement = New BoundReturnStatement(node.Syntax, - VisitExpressionNode(node.Expression), - Nothing, - Nothing) - - If instrumentQueryLambdaBody AndAlso Instrument Then - returnstmt = _instrumenterOpt.InstrumentQueryLambdaBody(node, returnstmt) - End If - - _instrumentTopLevelNonCompilerGeneratedExpressionsInQuery = save_createSequencePointsForTopLevelNonCompilerGeneratedExpressions - - For Each rangeVar As RangeVariableSymbol In nodeRangeVariables - _rangeVariableMap.Remove(rangeVar) - Next - - Dim lambdaBody = New BoundBlock(node.Syntax, - Nothing, - ImmutableArray(Of LocalSymbol).Empty, - ImmutableArray.Create(returnstmt)) - - Me._hasLambdas = True - - Dim result As BoundLambda = New BoundLambda(node.Syntax, - node.LambdaSymbol, - lambdaBody, - ImmutableArray(Of Diagnostic).Empty, - Nothing, - ConversionKind.DelegateRelaxationLevelNone, - MethodConversionKind.Identity) - - result.MakeCompilerGenerated() - - ' Done with lambda body rewrite, restore current lambda. - ' END LAMBDA REWRITE - Me._currentMethodOrLambda = originalMethodOrLambda - - Return result - End Function - - Private Sub PopulateRangeVariableMapForAnonymousType( + Private Shared Sub PopulateRangeVariableMapForAnonymousType( syntax As SyntaxNode, anonymousTypeInstance As BoundExpression, rangeVariables As ImmutableArray(Of RangeVariableSymbol), - ByRef firstUnmappedRangeVariable As Integer - ) + ByRef firstUnmappedRangeVariable As Integer, + rangeVariableMap As Dictionary(Of RangeVariableSymbol, BoundExpression), + inExpressionLambda As Boolean) + Dim anonymousType = DirectCast(anonymousTypeInstance.Type, AnonymousTypeManager.AnonymousTypePublicSymbol) For Each propertyDef As PropertySymbol In anonymousType.Properties Dim getCallOrPropertyAccess As BoundExpression = Nothing - If _inExpressionLambda Then + If inExpressionLambda Then ' NOTE: If we are in context of a lambda to be converted to an expression tree we need to use PropertyAccess. getCallOrPropertyAccess = New BoundPropertyAccess(syntax, propertyDef, @@ -162,16 +149,57 @@ Namespace Microsoft.CodeAnalysis.VisualBasic If propertyDefName.StartsWith("$"c, StringComparison.Ordinal) AndAlso Not String.Equals(propertyDefName, StringConstants.Group, StringComparison.Ordinal) Then ' Nested compound variable. Debug.Assert(propertyDefName.Equals(StringConstants.It) OrElse propertyDefName.Equals(StringConstants.It1) OrElse propertyDefName.Equals(StringConstants.It2)) - PopulateRangeVariableMapForAnonymousType(syntax, getCallOrPropertyAccess, rangeVariables, firstUnmappedRangeVariable) - + PopulateRangeVariableMapForAnonymousType(syntax, getCallOrPropertyAccess, rangeVariables, firstUnmappedRangeVariable, rangeVariableMap, inExpressionLambda) Else Debug.Assert(IdentifierComparison.Equals(propertyDefName, rangeVariables(firstUnmappedRangeVariable).Name)) - _rangeVariableMap.Add(rangeVariables(firstUnmappedRangeVariable), getCallOrPropertyAccess) + rangeVariableMap.Add(rangeVariables(firstUnmappedRangeVariable), getCallOrPropertyAccess) firstUnmappedRangeVariable += 1 End If Next End Sub + Friend Shared Function RewriteQueryLambdaBody( + expressionRewriter As Func(Of BoundExpression, BoundExpression), + originalNode As BoundQueryLambda, + rangeVariableMap As Dictionary(Of RangeVariableSymbol, BoundExpression), + Optional instrumenterOpt As Instrumenter = Nothing, + Optional instrumentQueryLambdaBody As Boolean = False) As BoundStatement + + Dim returnstmt As BoundStatement = New BoundReturnStatement(originalNode.Syntax, + expressionRewriter(originalNode.Expression), + Nothing, + Nothing) + + If instrumentQueryLambdaBody Then + returnstmt = instrumenterOpt.InstrumentQueryLambdaBody(originalNode, returnstmt) + End If + + For Each rangeVar As RangeVariableSymbol In originalNode.RangeVariables + rangeVariableMap.Remove(rangeVar) + Next + + Return returnstmt + End Function + + Friend Shared Function RewriteQueryLambda(rewrittenBody As BoundStatement, originalNode As BoundQueryLambda) As BoundLambda + Dim lambdaBody = New BoundBlock(originalNode.Syntax, + Nothing, + ImmutableArray(Of LocalSymbol).Empty, + ImmutableArray.Create(rewrittenBody)) + + Dim result As BoundLambda = New BoundLambda(originalNode.Syntax, + originalNode.LambdaSymbol, + lambdaBody, + ImmutableArray(Of Diagnostic).Empty, + Nothing, + ConversionKind.DelegateRelaxationLevelNone, + MethodConversionKind.Identity) + + result.MakeCompilerGenerated() + + Return result + End Function + Public Overrides Function VisitRangeVariable(node As BoundRangeVariable) As BoundNode Return _rangeVariableMap(node.RangeVariable) End Function diff --git a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb index 58fa4260a7162..ed5b290dc3fe1 100644 --- a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb +++ b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb @@ -236,15 +236,20 @@ Namespace Microsoft.CodeAnalysis.Semantics Case BoundKind.QueryExpression Return CreateBoundQueryExpressionOperation(DirectCast(boundNode, BoundQueryExpression)) Case BoundKind.QueryClause - Return CreateBoundQueryClauseOperation(DirectCast(boundNode, BoundQueryClause)) + ' Query clause has no special representation in the IOperation tree + Return Create(DirectCast(boundNode, BoundQueryClause).UnderlyingExpression) Case BoundKind.QueryableSource - Return CreateBoundQueryableSourceOperation(DirectCast(boundNode, BoundQueryableSource)) + ' Queryable source has no special representation in the IOperation tree + Return Create(DirectCast(boundNode, BoundQueryableSource).Source) Case BoundKind.AggregateClause - Return CreateBoundAggregateClauseOperation(DirectCast(boundNode, BoundAggregateClause)) + ' Aggregate clause has no special representation in the IOperation tree + Return Create(DirectCast(boundNode, BoundAggregateClause).UnderlyingExpression) Case BoundKind.Ordering - Return CreateBoundOrderingOperation(DirectCast(boundNode, BoundOrdering)) + ' Ordering clause has no special representation in the IOperation tree + Return Create(DirectCast(boundNode, BoundOrdering).UnderlyingExpression) Case BoundKind.GroupAggregation - Return CreateBoundGroupAggregationOperation((DirectCast(boundNode, BoundGroupAggregation))) + ' Group aggregation has no special representation in the IOperation tree + Return Create(DirectCast(boundNode, BoundGroupAggregation).Group) Case BoundKind.QuerySource ' Query source has no special representation in the IOperation tree Return Create(DirectCast(boundNode, BoundQuerySource).Expression) @@ -252,8 +257,9 @@ Namespace Microsoft.CodeAnalysis.Semantics ' Queryable collection conversion has no special representation in the IOperation tree Return Create(DirectCast(boundNode, BoundToQueryableCollectionConversion).ConversionCall) Case BoundKind.QueryLambda - ' Query lambda has no special representation in the IOperation tree - Return Create(DirectCast(boundNode, BoundQueryLambda).Expression) + ' Query lambda must be lowered to the regular lambda form for the operation tree. + Dim rewrittenLambda As BoundNode = RewriteQueryLambda(DirectCast(boundNode, BoundQueryLambda)) + Return Create(rewrittenLambda) Case BoundKind.RangeVariableAssignment ' Range variable assignment has no special representation in the IOperation tree Return Create(DirectCast(boundNode, BoundRangeVariableAssignment).Value) @@ -1212,138 +1218,12 @@ Namespace Microsoft.CodeAnalysis.Semantics Return New LazyPropertyReferenceExpression([property], instance, [property], argumentsInEvaluationOrder, _semanticModel, syntax, type, constantValue) End Function - Private Function CreateBoundQueryExpressionOperation(boundQueryExpression As BoundQueryExpression) As IQueryExpression - Dim lastClauseOrContinuation As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundQueryExpression.LastOperator)) + Private Function CreateBoundQueryExpressionOperation(boundQueryExpression As BoundQueryExpression) As IOperation + Dim expression As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundQueryExpression.LastOperator)) Dim syntax As SyntaxNode = boundQueryExpression.Syntax Dim type As ITypeSymbol = boundQueryExpression.Type Dim constantValue As [Optional](Of Object) = ConvertToOptional(boundQueryExpression.ConstantValueOpt) - Return New LazyQueryExpression(lastClauseOrContinuation, _semanticModel, syntax, type, constantValue) - End Function - - Private Function CreateBoundQueryClauseOperation(boundQueryClause As BoundQueryClause) As IOperation - Return CreateBoundQueryClauseOperation(boundQueryClause, boundQueryClause.UnderlyingExpression) - End Function - - Private Function CreateBoundQueryableSourceOperation(boundQueryClause As BoundQueryableSource) As IOperation - Return CreateBoundQueryClauseOperation(boundQueryClause, boundQueryClause.Source) - End Function - - Private Function CreateBoundQueryClauseOperation(boundQueryClause As BoundQueryClauseBase, underlyingExpression As BoundExpression) As IOperation - Dim syntax As SyntaxNode = boundQueryClause.Syntax - Dim clauseSyntaxKind = syntax.Kind - - If boundQueryClause.WasCompilerGenerated AndAlso clauseSyntaxKind = SyntaxKind.FromClause Then - ' Handle implicit select clause - ' VB generates bound query clause with From syntax only for implicit select. - ' The actual from clauses are generated for the underlying range variable declaration syntax nodes - clauseSyntaxKind = SyntaxKind.SelectClause - ElseIf clauseSyntaxKind = SyntaxKind.ExpressionRangeVariable OrElse clauseSyntaxKind = SyntaxKind.CollectionRangeVariable Then - ' VB Binder does not generate a bound node for few query clause syntax nodes (From and Let in the current implementation). - ' So we generate an Operation node for such nodes when we encounter the bound node for the first range variable child. - If IsFirstRangeVariableChildWhoseParentHasNoBoundNode(boundQueryClause) Then - syntax = syntax.Parent - clauseSyntaxKind = syntax.Kind - Else - ' Currently we do not generate IOperation nodes for range variable declarations. - Return Create(underlyingExpression) - End If - End If - - Dim reducedExpression As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(underlyingExpression)) - Dim type As ITypeSymbol = boundQueryClause.Type - Dim constantValue As [Optional](Of Object) = ConvertToOptional(boundQueryClause.ConstantValueOpt) - - Select Case clauseSyntaxKind - Case SyntaxKind.FromClause - Return New LazyFromQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.SelectClause - Return New LazySelectQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.WhereClause - Return New LazyWhereQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.LetClause - Return New LazyLetQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.OrderByClause - Return New LazyOrderByQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.GroupByClause - Return New LazyGroupByQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.GroupJoinClause - Return New LazyGroupJoinQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.SimpleJoinClause - Return New LazyJoinQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.DistinctClause - Return New LazyDistinctQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.AggregateClause - Return New LazyAggregateQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.SkipClause - Return New LazySkipQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.SkipWhileClause - Return New LazySkipWhileQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.TakeClause - Return New LazyTakeQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.TakeWhileClause - Return New LazyTakeWhileQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - Case SyntaxKind.FunctionAggregation - Return New LazyAggregationExpression(reducedExpression, isGroupAggregation:=False, semanticModel:=_semanticModel, syntax:=syntax, type:=type, constantValue:=constantValue) - Case Else - Throw ExceptionUtilities.Unreachable - End Select - End Function - - Private Function IsFirstRangeVariableChildWhoseParentHasNoBoundNode(boundQueryClause As BoundQueryClauseBase) As Boolean - ' VB Binder does not generate a bound node for few query clause syntax nodes (From and Let in the current implementation). - ' So we generate an Operation node for such nodes when we encounter the bound node for the first range variable child. - Select Case boundQueryClause.Syntax.Parent.Kind - Case SyntaxKind.FromClause, SyntaxKind.LetClause - Return IsFirstRangeVariableChild(boundQueryClause) - Case Else - Return False - End Select - End Function - - Private Function IsFirstRangeVariableChild(boundQueryClause As BoundQueryClauseBase) As Boolean - Select Case boundQueryClause.Syntax.Kind - Case SyntaxKind.ExpressionRangeVariable, SyntaxKind.CollectionRangeVariable - Return boundQueryClause.Syntax.Parent.ChildNodes().First Is boundQueryClause.Syntax - Case Else - Return False - End Select - End Function - - Private Function CreateBoundAggregateClauseOperation(boundAggregateClause As BoundAggregateClause) As IAggregateQueryClause - Dim reducedExpression As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundAggregateClause.UnderlyingExpression)) - Dim syntax As SyntaxNode = boundAggregateClause.Syntax - Dim type As ITypeSymbol = boundAggregateClause.Type - Dim constantValue As [Optional](Of Object) = ConvertToOptional(boundAggregateClause.ConstantValueOpt) - Return New LazyAggregateQueryClause(reducedExpression, _semanticModel, syntax, type, constantValue) - End Function - - Private Function CreateBoundOrderingOperation(boundOrdering As BoundOrdering) As IOrderingExpression - Dim expression As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundOrdering.UnderlyingExpression)) - Dim orderKind = GetOrderKind(DirectCast(boundOrdering.Syntax, OrderingSyntax)) - Dim syntax As SyntaxNode = boundOrdering.Syntax - Dim type As ITypeSymbol = boundOrdering.Type - Dim constantValue As [Optional](Of Object) = ConvertToOptional(boundOrdering.ConstantValueOpt) - Return New LazyOrderingExpression(expression, orderKind, _semanticModel, syntax, type, constantValue) - End Function - - Private Shared Function GetOrderKind(orderingSyntax As OrderingSyntax) As OrderKind - Select Case orderingSyntax.Kind - Case SyntaxKind.AscendingOrdering - Return OrderKind.Ascending - Case SyntaxKind.DescendingOrdering - Return OrderKind.Descending - Case Else - Return OrderKind.None - End Select - End Function - - Private Function CreateBoundGroupAggregationOperation(boundGroupAggregation As BoundGroupAggregation) As IAggregationExpression - Dim expression As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundGroupAggregation.Group)) - Dim isGroupAggregation = True - Dim syntax As SyntaxNode = boundGroupAggregation.Syntax - Dim type As ITypeSymbol = boundGroupAggregation.Type - Dim constantValue As [Optional](Of Object) = ConvertToOptional(boundGroupAggregation.ConstantValueOpt) - Return New LazyAggregationExpression(expression, isGroupAggregation, _semanticModel, syntax, type, constantValue) + Return New LazyTranslatedQueryExpression(expression, _semanticModel, syntax, type, constantValue) End Function End Class End Namespace diff --git a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb new file mode 100644 index 0000000000000..639c690ce5afc --- /dev/null +++ b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb @@ -0,0 +1,93 @@ +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +Imports Microsoft.CodeAnalysis.VisualBasic +Imports Microsoft.CodeAnalysis.VisualBasic.Symbols + +Namespace Microsoft.CodeAnalysis.Semantics + Partial Friend NotInheritable Class VisualBasicOperationFactory + Private Shared Function RewriteQueryLambda(node As BoundQueryLambda) As BoundNode + ' We rewrite query lambda into regular lambda with 2 passes. + ' Pass 1 uses helper methods from LocalRewriter to do the lowering. This introduces large number of DAGs. + ' Pass 2 walks over the lowered tree and replaces duplicate bound nodes in the tree with their clones - this is a requirement for the Operation tree. + Dim pass1Rewriter As New QueryLambdaRewriterPass1 + Dim rewrittenLambda As BoundLambda = DirectCast(pass1Rewriter.VisitQueryLambda(node), BoundLambda) + + Dim pass2Rewriter As New QueryLambdaRewriterPass2 + Return pass2Rewriter.VisitLambda(rewrittenLambda) + End Function + + Private NotInheritable Class QueryLambdaRewriterPass1 + Inherits BoundTreeRewriterWithStackGuard + Private _rangeVariableMap As Dictionary(Of RangeVariableSymbol, BoundExpression) + + Public Sub New() + _rangeVariableMap = Nothing + End Sub + + Public Overrides Function VisitQueryLambda(node As BoundQueryLambda) As BoundNode + LocalRewriter.PopulateRangeVariableMapForQueryLambdaRewrite(node, _rangeVariableMap, inExpressionLambda:=False) + Dim rewrittenBody As BoundStatement = LocalRewriter.RewriteQueryLambdaBody(AddressOf VisitExpressionWithStackGuard, node, _rangeVariableMap) + Return LocalRewriter.RewriteQueryLambda(rewrittenBody, node) + End Function + + Public Overrides Function VisitRangeVariable(node As BoundRangeVariable) As BoundNode + Dim expression As BoundExpression = Nothing + If Not _rangeVariableMap.TryGetValue(node.RangeVariable, expression) Then + ' _rangeVariableMap should contain an entry for the range variable, except for error cases. + Debug.Assert(node.HasErrors OrElse node.RangeVariable.Type.IsErrorType()) + Return node + End If + +#If DEBUG Then + ' Range variable reference should be rewritten to a parameter reference, or a call or a property access. + ' We clone these bound nodes in QueryLambdaRewriterPass2 to avoid dag in the generated bound tree. + ' If the LocalRewriter is changed to generate more kind of bound nodes for range variables, we should handle these in QueryLambdaRewriterPass2. + ' Below assert helps us to stay in sync with the LocalRewriter. + Select Case expression.Kind + Case BoundKind.Parameter + Case BoundKind.Call + Case BoundKind.PropertyAccess + Exit Select + Case Else + Debug.Fail($"Unexpected bound kind '{expression.Kind}' generated for range variable rewrite by method '{NameOf(LocalRewriter.PopulateRangeVariableMapForQueryLambdaRewrite)}'") + End Select +#End If + + Return expression + End Function + End Class + + Private NotInheritable Class QueryLambdaRewriterPass2 + Inherits BoundTreeRewriterWithStackGuard + Private ReadOnly _uniqueNodes As HashSet(Of BoundExpression) + + Public Sub New() + _uniqueNodes = New HashSet(Of BoundExpression) + End Sub + + Private Function HandleNode(Of T As BoundExpression)(node As T) As T + If Not _uniqueNodes.Add(node) Then + node = node.MemberwiseClone(Of T) + _uniqueNodes.Add(node) + End If + + Return node + End Function + + Public Overrides Function VisitParameter(node As BoundParameter) As BoundNode + node = DirectCast(MyBase.VisitParameter(node), BoundParameter) + Return HandleNode(node) + End Function + + Public Overrides Function VisitCall(node As BoundCall) As BoundNode + node = DirectCast(MyBase.VisitCall(node), BoundCall) + Return HandleNode(node) + End Function + + Public Overrides Function VisitPropertyAccess(node As BoundPropertyAccess) As BoundNode + node = DirectCast(MyBase.VisitPropertyAccess(node), BoundPropertyAccess) + Return HandleNode(node) + End Function + End Class + End Class +End Namespace diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb index d25f3f702d1ec..6c4a17dfc7ed8 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb @@ -1,4 +1,4 @@ -' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.Semantics Imports Microsoft.CodeAnalysis.Test.Utilities @@ -89,21 +89,22 @@ End Class ]]>.Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -130,19 +131,17 @@ Class C End Class]]>.Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -171,22 +170,22 @@ End Class]]>.Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -213,36 +212,43 @@ Class C End Class]]>.Value Dim expectedOperationTree = )) (Syntax: 'From y In x ... nto Count()') - LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group By w ... nto Count()') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.String).GroupBy(Of , )(keySelector As System.Func(Of System.String, ), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.String), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By w ... nto Count()') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.String)) (Syntax: 'y In x') +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'From y In x ... nto Count()') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.String).GroupBy(Of , )(keySelector As System.Func(Of System.String, ), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.String), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By w ... nto Count()') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.String)) (Syntax: 'y In x') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.String()) (Syntax: 'x') + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'x') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.String, )) (Syntax: 'x') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From y In x') - ReducedExpression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.String()) (Syntax: 'x') - Arguments(2): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'x') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.String, )) (Syntax: 'x') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By w ... nto Count()') - Initializers(2): - IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.String()) (Syntax: 'x') - IOperation: (OperationKind.None) (Syntax: 'y') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By w ... nto Count()') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.String), )) (Syntax: 'Group By w ... nto Count()') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By w ... nto Count()') - Initializers(3): - IOperation: (OperationKind.None) (Syntax: 'w') - IOperation: (OperationKind.None) (Syntax: 'z') - IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Count()') - Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.String).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') + Operand: ILambdaExpression (Signature: Function (y As System.String) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By w ... nto Count()') + Initializers(2): + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.String()) (Syntax: 'x') + IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.String) (Syntax: 'x') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By w ... nto Count()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.String), )) (Syntax: 'Group By w ... nto Count()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As , $VB$ItAnonymous As System.Collections.Generic.IEnumerable(Of System.String)) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Group By w ... nto Count()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Group By w ... nto Count()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group By w ... nto Count()') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By w ... nto Count()') + Initializers(3): + IInvocationExpression ( Function .get_w() As System.String()) (OperationKind.InvocationExpression, Type: System.String()) (Syntax: 'Group By w ... nto Count()') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Group By w ... nto Count()') + Arguments(0) + IInvocationExpression ( Function .get_z() As System.String) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'Group By w ... nto Count()') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Group By w ... nto Count()') + Arguments(0) + IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.String).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') Instance Receiver: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.String)) (Syntax: 'Group By w ... nto Count()') Arguments(0) - InConversion: null - OutConversion: null + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty diff --git a/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb b/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb index 30bff89932679..c32ee6e917076 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb @@ -1,5 +1,6 @@ ' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.VisualBasic Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Roslyn.Test.Utilities @@ -41,6 +42,7 @@ Select ]]>) End Sub + Public Sub ImplicitSelectClause_IOperation() Dim source = .Value -Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -128,6 +131,7 @@ Where End Sub + Public Sub WhereClause_IOperation() Dim source = .Value -Dim expectedOperationTree = s') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... here 10 > s') - LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where 10 > s') - ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where 10 > s') - Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where s > 0') - ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where s > 0') - Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') - ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') - Left: IOperation: (OperationKind.None) (Syntax: 's') - Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') - InConversion: null - OutConversion: null + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: QueryAble) (Syntax: 'From s In q ... here 10 > s') + Expression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where 10 > s') + Instance Receiver: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where s > 0') + Instance Receiver: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') - Left: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') - Right: IOperation: (OperationKind.None) (Syntax: 's') + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 's > 0') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 0') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 0') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 0') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: '10 > s') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '10 > s') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '10 > s') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') + Left: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + Right: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: '10 > s') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -231,6 +238,7 @@ Where System.Func`2[System.Int32,System.Boolean] End Sub + Public Sub WhereClause02_IOperation() Dim source = .Value -Dim expectedOperationTree = s') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... here 10 > s') - LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where 10 > s') - ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where 10 > s') - Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where s > 0') - ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where s > 0') - Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') - ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') - Left: IOperation: (OperationKind.None) (Syntax: 's') - Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') - InConversion: null - OutConversion: null + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: QueryAble) (Syntax: 'From s In q ... here 10 > s') + Expression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where 10 > s') + Instance Receiver: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where s > 0') + Instance Receiver: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') - Left: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') - Right: IOperation: (OperationKind.None) (Syntax: 's') + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 's > 0') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 0') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 0') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 0') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: '10 > s') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '10 > s') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '10 > s') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') + Left: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + Right: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: '10 > s') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -295,6 +306,7 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub Test4() Dim source = .Value Dim expectedOperationTree = 0') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble, IsInvalid) (Syntax: 'From s In q Where s > 0') - LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Where s > 0') - ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble, IsInvalid) (Syntax: 'Where s > 0') - Children(2): - IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Where s > 0') - IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') - Left: IOperation: (OperationKind.None) (Syntax: 's') - Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: QueryAble, IsInvalid) (Syntax: 'From s In q Where s > 0') + Expression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble, IsInvalid) (Syntax: 'Where s > 0') + Children(2): + IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Where s > 0') + ILambdaExpression (Signature: Function (s As System.Int32) As ?) (OperationKind.LambdaExpression, Type: null) (Syntax: 's > 0') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 0') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 0') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 0') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') ]]>.Value Dim expectedDiagnostics = Public Sub Test5() Dim source = .Value Dim expectedOperationTree = 0') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble, IsInvalid) (Syntax: 'From s In q Where s > 0') - LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Where s > 0') - ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble, IsInvalid) (Syntax: 'Where s > 0') - Children(2): - IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Where s > 0') - IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') - Left: IOperation: (OperationKind.None) (Syntax: 's') - Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: QueryAble, IsInvalid) (Syntax: 'From s In q Where s > 0') + Expression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble, IsInvalid) (Syntax: 'Where s > 0') + Children(2): + IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Where s > 0') + ILambdaExpression (Signature: Function (s As System.Int32) As ?) (OperationKind.LambdaExpression, Type: null) (Syntax: 's > 0') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 0') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 0') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 0') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') ]]>.Value Dim expectedDiagnostics = Public Sub Test6() Dim source = .Value Dim expectedOperationTree = 0') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble, IsInvalid) (Syntax: 'From s In q Where s > 0') - LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Where s > 0') - ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble, IsInvalid) (Syntax: 'Where s > 0') - Children(2): - IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Where s > 0') - IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') - Left: IOperation: (OperationKind.None) (Syntax: 's') - Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: QueryAble, IsInvalid) (Syntax: 'From s In q Where s > 0') + Expression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble, IsInvalid) (Syntax: 'Where s > 0') + Children(2): + IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Where s > 0') + ILambdaExpression (Signature: Function (s As System.Int32) As ?) (OperationKind.LambdaExpression, Type: null) (Syntax: 's > 0') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 0') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 0') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 0') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') ]]>.Value Dim expectedDiagnostics = Public Sub MultipleSelectClauses_IOperation() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -2076,6 +2102,7 @@ True End Sub + Public Sub Select1_IOperation() Dim source = .Value Dim expectedOperationTree = 0') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... ere Two > 0') - LastClauseOrContinuation: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where Two > 0') - ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where Two > 0') - Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select ind!Two') - ReducedExpression: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select ind!Two') - Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where Num2 ... 10 + Num1()') - ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where Num2 ... 10 + Num1()') - Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select Module1.Num2()') - ReducedExpression: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select Module1.Num2()') - Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where Num1 = -10') - ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where Num1 = -10') - Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select Num1()') - ReducedExpression: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select Num1()') - Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where s > 0') - ReducedExpression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where s > 0') - Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select s') - ReducedExpression: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select s') - Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') - ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's') - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') - Left: IOperation: (OperationKind.None) (Syntax: 's') - Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Num1()') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'Num1()') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IInvocationExpression (Function Module1.Num1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Num1()') - Instance Receiver: null - Arguments(0) - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Num1 = -10') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Num1 = -10') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'Num1 = -10') - Left: IOperation: (OperationKind.None) (Syntax: 'Num1') - Right: IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, Constant: -10) (Syntax: '-10') - Operand: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') - InConversion: null - OutConversion: null + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: QueryAble) (Syntax: 'From s In q ... ere Two > 0') + Expression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where Two > 0') + Instance Receiver: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select ind!Two') + Instance Receiver: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where Num2 ... 10 + Num1()') + Instance Receiver: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select Module1.Num2()') + Instance Receiver: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where Num1 = -10') + Instance Receiver: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select Num1()') + Instance Receiver: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where s > 0') + Instance Receiver: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select s') + Instance Receiver: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Module1.Num2()') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'Module1.Num2()') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IInvocationExpression (Function Module1.Num2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Module1.Num2()') - Instance Receiver: null - Arguments(0) + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's') + ReturnedValue: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's') InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 's > 0') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 0') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 0') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 0') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Num2 = -10 + Num1()') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Num2 = -10 + Num1()') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Num1()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'Num1()') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'Num2 = -10 + Num1()') - Left: IOperation: (OperationKind.None) (Syntax: 'Num2') - Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '-10 + Num1()') - Left: IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, Constant: -10) (Syntax: '-10') - Operand: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') - Right: IInvocationExpression (Function Module1.Num1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Num1()') + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Num1()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Num1()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Num1()') + ReturnedValue: IInvocationExpression (Function Module1.Num1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Num1()') Instance Receiver: null Arguments(0) InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Num1 = -10') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Num1 = -10') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (Num1 As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Num1 = -10') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Num1 = -10') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Num1 = -10') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'Num1 = -10') + Left: IParameterReferenceExpression: Num1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Num1 = -10') + Right: IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, Constant: -10) (Syntax: '-10') + Operand: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + InConversion: null + OutConversion: null Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'ind!Two') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'ind!Two') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Module1.Num2()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'Module1.Num2()') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IPropertyReferenceExpression: Property Module1.Index.Item(x As System.String) As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'ind!Two') + Operand: ILambdaExpression (Signature: Function (Num1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Module1.Num2()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Module1.Num2()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Module1.Num2()') + ReturnedValue: IInvocationExpression (Function Module1.Num2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Module1.Num2()') + Instance Receiver: null + Arguments(0) + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Num2 = -10 + Num1()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Num2 = -10 + Num1()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (Num2 As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Num2 = -10 + Num1()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Num2 = -10 + Num1()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Num2 = -10 + Num1()') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'Num2 = -10 + Num1()') + Left: IParameterReferenceExpression: Num2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Num2 = -10 + Num1()') + Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '-10 + Num1()') + Left: IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, Constant: -10) (Syntax: '-10') + Operand: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + Right: IInvocationExpression (Function Module1.Num1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Num1()') + Instance Receiver: null + Arguments(0) + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'ind!Two') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'ind!Two') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (Num2 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 'ind!Two') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'ind!Two') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'ind!Two') + ReturnedValue: IPropertyReferenceExpression: Property Module1.Index.Item(x As System.String) As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'ind!Two') Instance Receiver: ILocalReferenceExpression: ind (OperationKind.LocalReferenceExpression, Type: Module1.Index) (Syntax: 'ind') Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Two') ILiteralExpression (Text: Two) (OperationKind.LiteralExpression, Type: System.String, Constant: "Two") (Syntax: 'Two') InConversion: null OutConversion: null - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Two > 0') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Two > 0') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'Two > 0') - Left: IOperation: (OperationKind.None) (Syntax: 'Two') - Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Two > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 'Two > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (Two As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Two > 0') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Two > 0') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Two > 0') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'Two > 0') + Left: IParameterReferenceExpression: Two (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Two > 0') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -2970,6 +3012,7 @@ Where ]]>) End Sub + Public Sub Where1() Dim source = .Value -Dim expectedOperationTree = .Value Dim expectedDiagnostics = Public Sub While1() Dim source = 1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'From s In q ... While s > 1') - LastClauseOrContinuation: ITakeWhileQueryClause (Clause kind: TakeWhileClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Take While s > 1') - ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Take While s > 1') - Children(2): - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') - ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') - IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 1') - Left: IOperation: (OperationKind.None) (Syntax: 's') - Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'From s In q ... While s > 1') + Expression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Take While s > 1') + Children(2): + ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + ILambdaExpression (Signature: Function (s As System.Int32) As ?) (OperationKind.LambdaExpression, Type: null) (Syntax: 's > 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 1') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Dim q2 As O ... While s > 1') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'q2') Variables: Local_1: q2 As System.Object Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q ... While s > 1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IQueryExpression (OperationKind.QueryExpression, Type: ?, IsInvalid) (Syntax: 'From s In q ... While s > 1') - LastClauseOrContinuation: ISkipWhileQueryClause (Clause kind: SkipWhileClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Skip While s > 1') - ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Skip While s > 1') - Children(2): - IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') - ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') - IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 1') - Left: IOperation: (OperationKind.None) (Syntax: 's') - Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'From s In q ... While s > 1') + Expression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Skip While s > 1') + Children(2): + ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + ILambdaExpression (Signature: Function (s As System.Int32) As ?) (OperationKind.LambdaExpression, Type: null) (Syntax: 's > 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 1') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') ILabelStatement (Label: exit) (OperationKind.LabelStatement) (Syntax: 'End Sub') LabeledStatement: null IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'End Sub') @@ -3732,6 +3780,7 @@ Select End Sub + Public Sub SkipWhile_IOperation() Dim source = .Value Dim expectedOperationTree = 0') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... While s > 0') - LastClauseOrContinuation: ISkipWhileQueryClause (Clause kind: SkipWhileClause) (OperationKind.QueryClause) (Syntax: 'Skip While s > 0') - ReducedExpression: IInvocationExpression ( Function QueryAble.SkipWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Skip While s > 0') - Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') - ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') - Left: IOperation: (OperationKind.None) (Syntax: 's') - Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') - InConversion: null - OutConversion: null + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: QueryAble) (Syntax: 'From s In q ... While s > 0') + Expression: IInvocationExpression ( Function QueryAble.SkipWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Skip While s > 0') + Instance Receiver: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 's > 0') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 0') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 0') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 0') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -3792,6 +3842,7 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub TakeWhile_IOperation() Dim source = .Value -Dim expectedOperationTree = 0') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IQueryExpression (OperationKind.QueryExpression, Type: QueryAble) (Syntax: 'From s In q ... While s > 0') - LastClauseOrContinuation: ITakeWhileQueryClause (Clause kind: TakeWhileClause) (OperationKind.QueryClause) (Syntax: 'Take While s > 0') - ReducedExpression: IInvocationExpression ( Function QueryAble.TakeWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Take While s > 0') - Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') - ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') - Left: IOperation: (OperationKind.None) (Syntax: 's') - Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') - InConversion: null - OutConversion: null + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: QueryAble) (Syntax: 'From s In q ... While s > 0') + Expression: IInvocationExpression ( Function QueryAble.TakeWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Take While s > 0') + Instance Receiver: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 's > 0') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 0') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 0') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 0') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -3852,6 +3904,7 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub TakeWhileAndSkipWhile_IOperation() Dim source = .Value -Dim expectedOperationTree = 0') - ReducedExpression: IInvocationExpression ( Function QueryAble.SkipWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Skip While s > 0') - Instance Receiver: ITakeWhileQueryClause (Clause kind: TakeWhileClause) (OperationKind.QueryClause) (Syntax: 'Take While 10 > s') - ReducedExpression: IInvocationExpression ( Function QueryAble.TakeWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Take While 10 > s') - Instance Receiver: ISkipWhileQueryClause (Clause kind: SkipWhileClause) (OperationKind.QueryClause) (Syntax: 'Skip While s > 0') - ReducedExpression: IInvocationExpression ( Function QueryAble.SkipWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Skip While s > 0') - Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s In q') - ReducedExpression: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') - Left: IOperation: (OperationKind.None) (Syntax: 's') - Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') - Left: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') - Right: IOperation: (OperationKind.None) (Syntax: 's') - InConversion: null - OutConversion: null + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: QueryAble) (Syntax: 'From s In q ... 0 Select s') + Expression: IInvocationExpression ( Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Select s') + Instance Receiver: IInvocationExpression ( Function QueryAble.SkipWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Skip While s > 0') + Instance Receiver: IInvocationExpression ( Function QueryAble.TakeWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Take While 10 > s') + Instance Receiver: IInvocationExpression ( Function QueryAble.SkipWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Skip While s > 0') + Instance Receiver: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') - Left: IOperation: (OperationKind.None) (Syntax: 's') - Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 's > 0') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 0') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 0') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 0') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: '10 > s') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '10 > s') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '10 > s') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') + Left: ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') + Right: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: '10 > s') + InConversion: null + OutConversion: null Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's') + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 's > 0') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 0') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 0') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 0') + Right: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's') + ReturnedValue: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -3943,6 +4003,7 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub Distinct1() Dim source = .Value -Dim expectedOperationTree = .Value Dim expectedDiagnostics = Public Sub Distinct2_IOperation() Dim source = .Value -Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -4074,6 +4132,7 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub MultipleDistinct_IOperation() Dim source = .Value -Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -4234,6 +4292,7 @@ Skip 2 ]]>) End Sub + Public Sub Skip_IOperation() Dim source = .Value -Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -4286,6 +4343,7 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub Take_IOperation() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -4722,6 +4780,7 @@ OrderBy 0 ]]>) End Sub + Public Sub OrderByAscending_IOperation() Dim source = .Value -Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -4792,6 +4851,7 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub OrderByDescending_IOperation() Dim source = .Value -Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -4862,6 +4922,7 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub OrderByAscendingDescending_IOperation() Dim source = .Value -Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -5454,6 +5529,7 @@ End Module ]]>) End Sub + Public Sub Let_IOperation() Dim source = .Value -Dim expectedOperationTree = )) (Syntax: 'From s1 In ... s2 = s1 + 1') - LastClauseOrContinuation: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let s2 = s1 + 1') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of )(selector As System.Func(Of System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's2 = s1 + 1') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'From s1 In ... s2 = s1 + 1') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of )(selector As System.Func(Of System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's2 = s1 + 1') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') - Element Values(1): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's2 = s1 + 1') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') - Left: IOperation: (OperationKind.None) (Syntax: 's1') - Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null -]]>.Value - + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1 + 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1 + 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1 + 1') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's2 = s1 + 1') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1 + 1') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1 + 1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null +]]>.Value + Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub LetMultipleVariables_IOperation() Dim source = .Value -Dim expectedOperationTree = )) (Syntax: 'From s1 In ... 3 = s2 + s1') - LastClauseOrContinuation: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Select(Of )(selector As System.Func(Of , )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's3 = s2 + s1') - Instance Receiver: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let s2 = s1 ... 3 = s2 + s1') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of )(selector As System.Func(Of System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's2 = s1 + 1') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'From s1 In ... 3 = s2 + s1') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Select(Of )(selector As System.Func(Of , )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's3 = s2 + s1') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of )(selector As System.Func(Of System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's2 = s1 + 1') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') - Element Values(1): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's2 = s1 + 1') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') - Left: IOperation: (OperationKind.None) (Syntax: 's1') - Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1 + 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1 + 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1 + 1') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's2 = s1 + 1') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1 + 1') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1 + 1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's2 + s1') IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , )) (Syntax: 's2 + s1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's3 = s2 + s1') - Initializers(3): - IOperation: (OperationKind.None) (Syntax: 's1') - IOperation: (OperationKind.None) (Syntax: 's2') - IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 + s1') - Left: IOperation: (OperationKind.None) (Syntax: 's2') - Right: IOperation: (OperationKind.None) (Syntax: 's1') + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 's2 + s1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's2 + s1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2 + s1') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's3 = s2 + s1') + Initializers(3): + IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2 + s1') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2 + s1') + Arguments(0) + IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2 + s1') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2 + s1') + Arguments(0) + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 + s1') + Left: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2 + s1') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2 + s1') + Arguments(0) + Right: IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2 + s1') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2 + s1') + Arguments(0) InConversion: null OutConversion: null ]]>.Value @@ -5570,6 +5660,7 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub LetMultipleClauses_IOperation() Dim source = .Value -Dim expectedOperationTree = )) (Syntax: 'From s1 In ... 2 + s3 + s4') - LastClauseOrContinuation: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>, Key s4 As System.Int32>).Select(Of )(selector As System.Func(Of , Key s3 As System.Int32>, Key s4 As System.Int32>, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's5 = s1 + s2 + s3 + s4') - Instance Receiver: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let s4 = s1 ... 2 + s3 + s4') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>).Select(Of , Key s3 As System.Int32>, Key s4 As System.Int32>)(selector As System.Func(Of , Key s3 As System.Int32>, , Key s3 As System.Int32>, Key s4 As System.Int32>)) As System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>, Key s4 As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>, Key s4 As System.Int32>)) (Syntax: 's4 = s1 + s2 + s3') - Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Select(Of , Key s3 As System.Int32>)(selector As System.Func(Of , , Key s3 As System.Int32>)) As System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>)) (Syntax: 's3 = s2 + s1') - Instance Receiver: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let s2 = s1 ... 3 = s2 + s1') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of )(selector As System.Func(Of System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's2 = s1 + 1') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {3}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {3}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {3}') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{3}') - Element Values(1): - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's2 = s1 + 1') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'From s1 In ... 2 + s3 + s4') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>, Key s4 As System.Int32>).Select(Of )(selector As System.Func(Of , Key s3 As System.Int32>, Key s4 As System.Int32>, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's5 = s1 + s2 + s3 + s4') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>).Select(Of , Key s3 As System.Int32>, Key s4 As System.Int32>)(selector As System.Func(Of , Key s3 As System.Int32>, , Key s3 As System.Int32>, Key s4 As System.Int32>)) As System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>, Key s4 As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>, Key s4 As System.Int32>)) (Syntax: 's4 = s1 + s2 + s3') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Select(Of , Key s3 As System.Int32>)(selector As System.Func(Of , , Key s3 As System.Int32>)) As System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key s3 As System.Int32>)) (Syntax: 's3 = s2 + s1') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of )(selector As System.Func(Of System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 's2 = s1 + 1') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {3}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{3}') + Element Values(1): + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 + 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1 + 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1 + 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1 + 1') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's2 = s1 + 1') Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1 + 1') IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') - Left: IOperation: (OperationKind.None) (Syntax: 's1') + Left: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1 + 1') Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's2 + s1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , , Key s3 As System.Int32>)) (Syntax: 's2 + s1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's3 = s2 + s1') - Initializers(2): - IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's3 = s2 + s1') - IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 + s1') - Left: IOperation: (OperationKind.None) (Syntax: 's2') - Right: IOperation: (OperationKind.None) (Syntax: 's1') InConversion: null OutConversion: null Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + s2 + s3') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key s3 As System.Int32>, , Key s3 As System.Int32>, Key s4 As System.Int32>)) (Syntax: 's1 + s2 + s3') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's2 + s1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , , Key s3 As System.Int32>)) (Syntax: 's2 + s1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's4 = s1 + s2 + s3') - Initializers(2): - IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's4 = s1 + s2 + s3') - IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') - Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2') - Left: IOperation: (OperationKind.None) (Syntax: 's1') - Right: IOperation: (OperationKind.None) (Syntax: 's2') - Right: IOperation: (OperationKind.None) (Syntax: 's3') + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As , Key s3 As System.Int32>) (OperationKind.LambdaExpression, Type: null) (Syntax: 's2 + s1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's2 + s1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2 + s1') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's3 = s2 + s1') + Initializers(2): + IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's3 = s2 + s1') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 + s1') + Left: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2 + s1') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2 + s1') + Arguments(0) + Right: IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2 + s1') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2 + s1') + Arguments(0) InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + s2 + s3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key s3 As System.Int32>, , Key s3 As System.Int32>, Key s4 As System.Int32>)) (Syntax: 's1 + s2 + s3') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As , Key s3 As System.Int32>) As , Key s3 As System.Int32>, Key s4 As System.Int32>) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1 + s2 + s3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1 + s2 + s3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1 + s2 + s3') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's4 = s1 + s2 + s3') + Initializers(2): + IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's4 = s1 + s2 + s3') + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2') + Left: IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') + Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>.get_$VB$It() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 's1 + s2 + s3') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3') + Arguments(0) + Arguments(0) + Right: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') + Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>.get_$VB$It() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 's1 + s2 + s3') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3') + Arguments(0) + Arguments(0) + Right: IInvocationExpression ( Function , Key s3 As System.Int32>.get_s3() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3') + Arguments(0) + InConversion: null + OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + s2 + s3 + s4') IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key s3 As System.Int32>, Key s4 As System.Int32>, )) (Syntax: 's1 + s2 + s3 + s4') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's5 = s1 + s2 + s3 + s4') - Initializers(5): - IOperation: (OperationKind.None) (Syntax: 's1') - IOperation: (OperationKind.None) (Syntax: 's2') - IOperation: (OperationKind.None) (Syntax: 's3') - IOperation: (OperationKind.None) (Syntax: 's4') - IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') - Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') - Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2') - Left: IOperation: (OperationKind.None) (Syntax: 's1') - Right: IOperation: (OperationKind.None) (Syntax: 's2') - Right: IOperation: (OperationKind.None) (Syntax: 's3') - Right: IOperation: (OperationKind.None) (Syntax: 's4') + Operand: ILambdaExpression (Signature: Function ($VB$It As , Key s3 As System.Int32>, Key s4 As System.Int32>) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1 + s2 + s3 + s4') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1 + s2 + s3 + s4') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1 + s2 + s3 + s4') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's5 = s1 + s2 + s3 + s4') + Initializers(5): + IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>.get_$VB$It() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_$VB$It() As , Key s3 As System.Int32>) (OperationKind.InvocationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Arguments(0) + Arguments(0) + Arguments(0) + IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>.get_$VB$It() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_$VB$It() As , Key s3 As System.Int32>) (OperationKind.InvocationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Arguments(0) + Arguments(0) + Arguments(0) + IInvocationExpression ( Function , Key s3 As System.Int32>.get_s3() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_$VB$It() As , Key s3 As System.Int32>) (OperationKind.InvocationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Arguments(0) + Arguments(0) + IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_s4() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Arguments(0) + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2') + Left: IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>.get_$VB$It() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_$VB$It() As , Key s3 As System.Int32>) (OperationKind.InvocationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Arguments(0) + Arguments(0) + Arguments(0) + Right: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>.get_$VB$It() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_$VB$It() As , Key s3 As System.Int32>) (OperationKind.InvocationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Arguments(0) + Arguments(0) + Arguments(0) + Right: IInvocationExpression ( Function , Key s3 As System.Int32>.get_s3() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_$VB$It() As , Key s3 As System.Int32>) (OperationKind.InvocationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Arguments(0) + Arguments(0) + Right: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_s4() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Arguments(0) InConversion: null OutConversion: null ]]>.Value @@ -7107,6 +7257,7 @@ End Module ]]>) End Sub + Public Sub Join_IOperation() Dim source = .Value -Dim expectedOperationTree = )) (Syntax: 'From s1 In ... 1 Equals s2') - LastClauseOrContinuation: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join s2 In ... 1 Equals s2') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s2 In ... 1 Equals s2') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 3}') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'From s1 In ... 1 Equals s2') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s2 In ... 1 Equals s2') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 3}') + Element Values(2): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... er() {1, 3}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 3}') - Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 3}') - Element Values(2): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - Arguments(4): - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') - Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{2, 3}') - Element Values(2): - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s2 In ... 1 Equals s2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join s2 In ... 1 Equals s2') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s2 In ... 1 Equals s2') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IOperation: (OperationKind.None) (Syntax: 's2') - InConversion: null - OutConversion: null + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{2, 3}') + Element Values(2): + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s2 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2') + ReturnedValue: IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s2 In ... 1 Equals s2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join s2 In ... 1 Equals s2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32, s2 As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Join s2 In ... 1 Equals s2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Join s2 In ... 1 Equals s2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Join s2 In ... 1 Equals s2') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s2 In ... 1 Equals s2') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Join s2 In ... 1 Equals s2') + IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Join s2 In ... 1 Equals s2') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -7181,6 +7339,7 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub JoinMultiple_IOperation() Dim source = .Value -Dim expectedOperationTree = )) (Syntax: 'From s1 In ... uals s2 * 2') - LastClauseOrContinuation: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join s3 In ... uals s2 * 2') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s3 In ... uals s2 * 2') - Instance Receiver: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join s2 In ... 1 Equals s2') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s2 In ... 1 Equals s2') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') - Element Values(1): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - Arguments(4): - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') - Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{2, 3}') - Element Values(2): - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1 + 1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') - Left: IOperation: (OperationKind.None) (Syntax: 's1') - Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s2 In ... 1 Equals s2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join s2 In ... 1 Equals s2') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s2 In ... 1 Equals s2') - Initializers(2): - IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') - IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2') - InConversion: null - OutConversion: null + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'From s1 In ... uals s2 * 2') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s3 In ... uals s2 * 2') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s2 In ... 1 Equals s2') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') Arguments(4): - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's3 In New I ... er() {4, 5}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New I ... er() {4, 5}') + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {4, 5}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {4, 5}') - Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{4, 5}') + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{2, 3}') Element Values(2): - ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') - ILiteralExpression (Text: 5) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 5) (Syntax: '5') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') InConversion: null OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's3') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's3') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1 + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 * 2') - Left: IOperation: (OperationKind.None) (Syntax: 's2') - Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1 + 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1 + 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1 + 1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1 + 1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: null OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2 * 2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2 * 2') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's3') + Operand: ILambdaExpression (Signature: Function (s2 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2') + ReturnedValue: IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2') InConversion: null OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s3 In ... uals s2 * 2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join s3 In ... uals s2 * 2') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s2 In ... 1 Equals s2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join s2 In ... 1 Equals s2') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s3 In ... uals s2 * 2') - Initializers(3): - IOperation: (OperationKind.None) (Syntax: 's1') - IOperation: (OperationKind.None) (Syntax: 's2') - IOperation: (OperationKind.None) (Syntax: 's3') + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32, s2 As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Join s2 In ... 1 Equals s2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Join s2 In ... 1 Equals s2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Join s2 In ... 1 Equals s2') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s2 In ... 1 Equals s2') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2') InConversion: null OutConversion: null + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's3 In New I ... er() {4, 5}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New I ... er() {4, 5}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {4, 5}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {4, 5}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{4, 5}') + Element Values(2): + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + ILiteralExpression (Text: 5) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 5) (Syntax: '5') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's3') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's3') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 * 2') + Left: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's3') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's3') + Arguments(0) + Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2 * 2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2 * 2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s3 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's2 * 2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's2 * 2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2 * 2') + ReturnedValue: IParameterReferenceExpression: s3 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2 * 2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s3 In ... uals s2 * 2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join s3 In ... uals s2 * 2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It1 As , s3 As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Join s3 In ... uals s2 * 2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Join s3 In ... uals s2 * 2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Join s3 In ... uals s2 * 2') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s3 In ... uals s2 * 2') + Initializers(3): + IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Join s3 In ... uals s2 * 2') + Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Join s3 In ... uals s2 * 2') + Arguments(0) + IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Join s3 In ... uals s2 * 2') + Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Join s3 In ... uals s2 * 2') + Arguments(0) + IParameterReferenceExpression: s3 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Join s3 In ... uals s2 * 2') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -8178,6 +8358,7 @@ Select System.Func`2[VB$AnonymousType_11`2[VB$AnonymousType_7`2[VB$AnonymousType ]]>) End Sub + Public Sub Join4() Dim source = .Value -Dim expectedOperationTree = , IsInvalid) (Syntax: 'Join t1 In ... 1 Equals t1') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IOperation: (OperationKind.None) (Syntax: 't1') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'From s1 In ... 1 Equals t1') + Expression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Join t1 In ... 1 Equals t1') + Children(5): + ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + ILambdaExpression (Signature: Function (s1 As System.Int32) As ?) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + ILambdaExpression (Signature: Function (t1 As System.Int32) As ?) (OperationKind.LambdaExpression, Type: null) (Syntax: 't1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 't1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 't1') + ReturnedValue: IParameterReferenceExpression: t1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 't1') + ILambdaExpression (Signature: Function (s1 As System.Int32, t1 As System.Int32) As ) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'Join t1 In ... 1 Equals t1') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'Join t1 In ... 1 Equals t1') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'Join t1 In ... 1 Equals t1') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , IsInvalid) (Syntax: 'Join t1 In ... 1 Equals t1') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'Join t1 In ... 1 Equals t1') + IParameterReferenceExpression: t1 (OperationKind.ParameterReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'Join t1 In ... 1 Equals t1') ]]>.Value Dim expectedDiagnostics = ) End Sub + Public Sub GroupBy_GroupAggregation_IOperation() Dim source = .Value -Dim expectedOperationTree = )) (Syntax: 'From s1 In ... Into Group') - LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group By s1 Into Group') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By s1 Into Group') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... Into Group') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By s1 Into Group') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Initializer: IArrayInitializer (6 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2, 3, 4, 2, 3}') + Element Values(6): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... 3, 4, 2, 3}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: 'New Integer ... 3, 4, 2, 3}') - Initializer: IArrayInitializer (6 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2, 3, 4, 2, 3}') - Element Values(6): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - Arguments(2): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By s1 Into Group') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By s1 Into Group') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By s1 Into Group') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group') - Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group By s1 Into Group') - InConversion: null - OutConversion: null + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By s1 Into Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By s1 Into Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32, $VB$ItAnonymous As System.Collections.Generic.IEnumerable(Of System.Int32)) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Group By s1 Into Group') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Group By s1 Into Group') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group By s1 Into Group') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By s1 Into Group') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Group By s1 Into Group') + IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group By s1 Into Group') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -8435,6 +8627,7 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub GroupBy_FunctionAggregation_IOperation() Dim source = .Value -Dim expectedOperationTree = )) (Syntax: 'From s1 In ... nto Count()') - LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group By s1 Into Count()') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By s1 Into Count()') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... nto Count()') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By s1 Into Count()') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Initializer: IArrayInitializer (6 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2, 3, 4, 2, 3}') + Element Values(6): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... 3, 4, 2, 3}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: 'New Integer ... 3, 4, 2, 3}') - Initializer: IArrayInitializer (6 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2, 3, 4, 2, 3}') - Element Values(6): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - Arguments(2): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By s1 Into Count()') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By s1 Into Count()') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By s1 Into Count()') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Count()') - Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By s1 Into Count()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By s1 Into Count()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32, $VB$ItAnonymous As System.Collections.Generic.IEnumerable(Of System.Int32)) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Group By s1 Into Count()') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Group By s1 Into Count()') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group By s1 Into Count()') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By s1 Into Count()') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Group By s1 Into Count()') + IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') Instance Receiver: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group By s1 Into Count()') Arguments(0) - InConversion: null - OutConversion: null + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -8498,6 +8694,7 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub GroupBy_WithOptionalGroupClause_IOperation() Dim source = .Value -Dim expectedOperationTree = )) (Syntax: 'From s1 In ... Into Group') - LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group s1 By ... Into Group') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), elementSelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1 By ... Into Group') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... Into Group') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), elementSelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1 By ... Into Group') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Initializer: IArrayInitializer (6 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2, 3, 4, 2, 3}') + Element Values(6): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(3): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... 3, 4, 2, 3}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: 'New Integer ... 3, 4, 2, 3}') - Initializer: IArrayInitializer (6 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2, 3, 4, 2, 3}') - Element Values(6): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - Arguments(3): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: elementSelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group s1 By ... Into Group') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group s1 By ... Into Group') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group s1 By ... Into Group') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group') - Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group s1 By ... Into Group') - InConversion: null - OutConversion: null + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: elementSelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group s1 By ... Into Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group s1 By ... Into Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32, $VB$ItAnonymous As System.Collections.Generic.IEnumerable(Of System.Int32)) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Group s1 By ... Into Group') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Group s1 By ... Into Group') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group s1 By ... Into Group') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group s1 By ... Into Group') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Group s1 By ... Into Group') + IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group s1 By ... Into Group') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -8568,6 +8771,7 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub GroupBy_MultipleAggregations_IOperation() Dim source = .Value Dim expectedOperationTree = ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'From s1 In ... (), Max(s1)') - LastClauseOrContinuation: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group s1, s ... (), Max(s1)') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of , , ), Key c As System.Int32, Key Max As System.Int32>)(keySelector As System.Func(Of System.Int32, ), elementSelector As System.Func(Of System.Int32, ), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of ), ), Key c As System.Int32, Key Max As System.Int32>)) As System.Collections.Generic.IEnumerable(Of ), Key c As System.Int32, Key Max As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'Group s1, s ... (), Max(s1)') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') +ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable(Of ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'From s1 In ... (), Max(s1)') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of , , ), Key c As System.Int32, Key Max As System.Int32>)(keySelector As System.Func(Of System.Int32, ), elementSelector As System.Func(Of System.Int32, ), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of ), ), Key c As System.Int32, Key Max As System.Int32>)) As System.Collections.Generic.IEnumerable(Of ), Key c As System.Int32, Key Max As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'Group s1, s ... (), Max(s1)') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... 3, 4, 2, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: 'New Integer ... 3, 4, 2, 3}') + Initializer: IArrayInitializer (6 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2, 3, 4, 2, 3}') + Element Values(6): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(3): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1 Mod 2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 Mod 2') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... 3, 4, 2, 3}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer ... 3, 4, 2, 3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 6) (Syntax: 'New Integer ... 3, 4, 2, 3}') - Initializer: IArrayInitializer (6 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2, 3, 4, 2, 3}') - Element Values(6): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - Arguments(3): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 's1 Mod 2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1 Mod 2') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group s1, s ... (), Max(s1)') - Initializers(2): - IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 Mod 2') - Left: IOperation: (OperationKind.None) (Syntax: 's1') - Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 Mod 3') - Left: IOperation: (OperationKind.None) (Syntax: 's1') - Right: ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: elementSelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group s1, s ... (), Max(s1)') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String) (Syntax: 'CStr(s1)') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group s1, s ... (), Max(s1)') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of ), ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'Group s1, s ... (), Max(s1)') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ), Key c As System.Int32, Key Max As System.Int32>) (Syntax: 'Group s1, s ... (), Max(s1)') - Initializers(5): - IOperation: (OperationKind.None) (Syntax: 's1') - IOperation: (OperationKind.None) (Syntax: 's2') - IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group') - Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1, s ... (), Max(s1)') - IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Count()') - Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1 Mod 2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1 Mod 2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1 Mod 2') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group s1, s ... (), Max(s1)') + Initializers(2): + IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 Mod 2') + Left: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1 Mod 2') + Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + IBinaryOperatorExpression (BinaryOperationKind.IntegerRemainder) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 Mod 3') + Left: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1 Mod 2') + Right: ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: elementSelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, )) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group s1, s ... (), Max(s1)') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String) (Syntax: 'CStr(s1)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group s1, s ... (), Max(s1)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of ), ), Key c As System.Int32, Key Max As System.Int32>)) (Syntax: 'Group s1, s ... (), Max(s1)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As , $VB$ItAnonymous As System.Collections.Generic.IEnumerable(Of )) As ), Key c As System.Int32, Key Max As System.Int32>) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Group s1, s ... (), Max(s1)') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Group s1, s ... (), Max(s1)') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group s1, s ... (), Max(s1)') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ), Key c As System.Int32, Key Max As System.Int32>) (Syntax: 'Group s1, s ... (), Max(s1)') + Initializers(5): + IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Group s1, s ... (), Max(s1)') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Group s1, s ... (), Max(s1)') + Arguments(0) + IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Group s1, s ... (), Max(s1)') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Group s1, s ... (), Max(s1)') + Arguments(0) + IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1, s ... (), Max(s1)') + IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') Instance Receiver: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1, s ... (), Max(s1)') Arguments(0) - IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Max(s1)') - Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Max(selector As System.Func(Of , System.Int32)) As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Max(s1)') + IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Max(selector As System.Func(Of , System.Int32)) As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Max(s1)') Instance Receiver: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1, s ... (), Max(s1)') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1') IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's1') + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's1') + Arguments(0) InConversion: null OutConversion: null - InConversion: null - OutConversion: null + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -8665,6 +8882,7 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub GroupBy_WithJoin_IOperation() Dim source = .Value -Dim expectedOperationTree = )) (Syntax: 'From s1 In ... y Equals s1') - LastClauseOrContinuation: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join s1 In ... y Equals s1') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s1 In ... y Equals s1') - Instance Receiver: IGroupByQueryClause (Clause kind: GroupByClause) (OperationKind.QueryClause) (Syntax: 'Group By ke ... Into Group') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By ke ... Into Group') - Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select s1 + 1') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of System.Int32)(selector As System.Func(Of System.Int32, System.Int32)) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Select s1 + 1') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 2}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... er() {1, 2}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 2}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 2}') - Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2}') - Element Values(2): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') - Left: IOperation: (OperationKind.None) (Syntax: 's1') - Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null - Arguments(2): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: '1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: '1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By ke ... Into Group') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By ke ... Into Group') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By ke ... Into Group') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 'key') - IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group') - Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group By ke ... Into Group') - InConversion: null - OutConversion: null - Arguments(4): - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's1 In New I ... er() {1, 2}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 2}') + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... y Equals s1') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join s1 In ... y Equals s1') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupBy(Of System.Int32, )(keySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By ke ... Into Group') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of System.Int32)(selector As System.Func(Of System.Int32, System.Int32)) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Select s1 + 1') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 2}') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 2}') Dimension Sizes(1): @@ -8742,30 +8919,90 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi Element Values(2): ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 'key') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 'key') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 'key') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 's1 + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1 + 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1 + 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1 + 1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1 + 1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: '1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's1') + Operand: ILambdaExpression (Signature: Function ($VB$ItAnonymous As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: '1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '1') + ReturnedValue: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: null OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s1 In ... y Equals s1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join s1 In ... y Equals s1') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By ke ... Into Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group By ke ... Into Group') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s1 In ... y Equals s1') - Initializers(3): - IOperation: (OperationKind.None) (Syntax: 'key') - IOperation: (OperationKind.None) (Syntax: 'Group') - IOperation: (OperationKind.None) (Syntax: 's1') + Operand: ILambdaExpression (Signature: Function (key As System.Int32, $VB$ItAnonymous As System.Collections.Generic.IEnumerable(Of System.Int32)) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Group By ke ... Into Group') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Group By ke ... Into Group') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group By ke ... Into Group') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By ke ... Into Group') + Initializers(2): + IParameterReferenceExpression: key (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Group By ke ... Into Group') + IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group By ke ... Into Group') InConversion: null OutConversion: null + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's1 In New I ... er() {1, 2}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 2}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 2}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 2}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 2}') + Element Values(2): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 'key') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 'key') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 'key') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'key') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'key') + ReturnedValue: IInvocationExpression ( Function .get_key() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'key') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'key') + Arguments(0) + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join s1 In ... y Equals s1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join s1 In ... y Equals s1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It1 As , s1 As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Join s1 In ... y Equals s1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Join s1 In ... y Equals s1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Join s1 In ... y Equals s1') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s1 In ... y Equals s1') + Initializers(3): + IInvocationExpression ( Function .get_key() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Join s1 In ... y Equals s1') + Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Join s1 In ... y Equals s1') + Arguments(0) + IInvocationExpression ( Function .get_Group() As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Join s1 In ... y Equals s1') + Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Join s1 In ... y Equals s1') + Arguments(0) + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Join s1 In ... y Equals s1') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -8938,6 +9175,7 @@ BC36600: Range variable 's1' is already declared. ) End Sub + Public Sub GroupBy3() Dim source = .Value -Dim expectedOperationTree = , IsInvalid) (Syntax: 'Group By s1 Into Group') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: ?) (Syntax: 'Group') - Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: ?, IsInvalid) (Syntax: 'Group By s1 Into Group') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'From s1 In ... Into Group') + Expression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Group By s1 Into Group') + Children(3): + ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + ILambdaExpression (Signature: Function (s1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + ILambdaExpression (Signature: Function (s1 As System.Int32, $VB$ItAnonymous As ?) As ) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'Group By s1 Into Group') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'Group By s1 Into Group') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'Group By s1 Into Group') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , IsInvalid) (Syntax: 'Group By s1 Into Group') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'Group By s1 Into Group') + IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: ?, IsInvalid) (Syntax: 'Group By s1 Into Group') ]]>.Value Dim expectedDiagnostics = ) End Sub + Public Sub GroupJoin_IOperation() Dim source = .Value -Dim expectedOperationTree = )) (Syntax: 'From s1 In ... Into Group') - LastClauseOrContinuation: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause) (Syntax: 'Group Join ... Into Group') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupJoin(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... Into Group') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 3}') + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... Into Group') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupJoin(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... Into Group') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New I ... er() {1, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 3}') + Element Values(2): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... er() {1, 3}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 3}') - Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 3}') - Element Values(2): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - Arguments(4): - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') - Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{2, 3}') - Element Values(2): - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... Into Group') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... Into Group') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... Into Group') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group') - Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... Into Group') - InConversion: null - OutConversion: null + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{2, 3}') + Element Values(2): + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s2 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2') + ReturnedValue: IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... Into Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... Into Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32, $VB$ItAnonymous As System.Collections.Generic.IEnumerable(Of System.Int32)) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Group Join ... Into Group') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Group Join ... Into Group') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group Join ... Into Group') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... Into Group') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Group Join ... Into Group') + IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... Into Group') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -9392,6 +9640,7 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub GroupJoin_Nested_IOperation() Dim source = .Value -Dim expectedOperationTree = )) (Syntax: 'From s1 In ... gr2 = Group') - LastClauseOrContinuation: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause) (Syntax: 'Group Join ... gr2 = Group') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).GroupJoin(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... gr2 = Group') - Instance Receiver: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause) (Syntax: 'Group Join ... gr1 = Group') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupJoin(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... gr1 = Group') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') - Element Values(1): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - Arguments(4): - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') - Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{2, 3}') - Element Values(2): - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1 + 1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') - Left: IOperation: (OperationKind.None) (Syntax: 's1') - Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... gr1 = Group') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... gr1 = Group') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... gr1 = Group') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group') - Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... gr1 = Group') - InConversion: null - OutConversion: null + Dim expectedOperationTree = )) (Syntax: 'From s1 In ... gr2 = Group') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).GroupJoin(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... gr2 = Group') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupJoin(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... gr1 = Group') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') Arguments(4): - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's3 In New I ... er() {4, 5}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New I ... er() {4, 5}') + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's2 In New I ... er() {2, 3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New I ... er() {2, 3}') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {4, 5}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}') Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {4, 5}') - Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{4, 5}') + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{2, 3}') Element Values(2): - ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') - ILiteralExpression (Text: 5) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 5) (Syntax: '5') + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') InConversion: null OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's3') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's3') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1 + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1 + 1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '(s1 + 1) * 2') - Left: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Int32) (Syntax: '(s1 + 1)') - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') - Left: IOperation: (OperationKind.None) (Syntax: 's1') + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1 + 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1 + 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1 + 1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1 + 1') Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') InConversion: null OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: '(s1 + 1) * 2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: '(s1 + 1) * 2') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's3') + Operand: ILambdaExpression (Signature: Function (s2 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2') + ReturnedValue: IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2') InConversion: null OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... gr2 = Group') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... gr2 = Group') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... gr1 = Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... gr1 = Group') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... gr2 = Group') - Initializers(3): - IOperation: (OperationKind.None) (Syntax: 's1') - IOperation: (OperationKind.None) (Syntax: 'gr1') - IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group') - Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... gr2 = Group') + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32, $VB$ItAnonymous As System.Collections.Generic.IEnumerable(Of System.Int32)) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Group Join ... gr1 = Group') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Group Join ... gr1 = Group') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group Join ... gr1 = Group') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... gr1 = Group') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Group Join ... gr1 = Group') + IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... gr1 = Group') InConversion: null OutConversion: null + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's3 In New I ... er() {4, 5}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New I ... er() {4, 5}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {4, 5}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {4, 5}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{4, 5}') + Element Values(2): + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + ILiteralExpression (Text: 5) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 5) (Syntax: '5') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's3') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's3') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerMultiply) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '(s1 + 1) * 2') + Left: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Int32) (Syntax: '(s1 + 1)') + Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') + Left: IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's3') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's3') + Arguments(0) + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: '(s1 + 1) * 2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: '(s1 + 1) * 2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s3 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: '(s1 + 1) * 2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '(s1 + 1) * 2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: '(s1 + 1) * 2') + ReturnedValue: IParameterReferenceExpression: s3 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: '(s1 + 1) * 2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... gr2 = Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32), )) (Syntax: 'Group Join ... gr2 = Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As , $VB$ItAnonymous As System.Collections.Generic.IEnumerable(Of System.Int32)) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Group Join ... gr2 = Group') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Group Join ... gr2 = Group') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group Join ... gr2 = Group') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... gr2 = Group') + Initializers(3): + IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Group Join ... gr2 = Group') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Group Join ... gr2 = Group') + Arguments(0) + IInvocationExpression ( Function .get_gr1() As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... gr2 = Group') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Group Join ... gr2 = Group') + Arguments(0) + IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... gr2 = Group') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -9518,6 +9786,7 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub GroupJoin_NestedJoin_IOperation() Dim source = .Value -Dim expectedOperationTree = )>)) (Syntax: 'From s1 In ... s3 = Group') - LastClauseOrContinuation: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... s3 = Group') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of )>).Select(Of )>)(selector As System.Func(Of )>, )>)) As System.Collections.Generic.IEnumerable(Of )>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )>)) (Syntax: 'From s1 In ... s3 = Group') - Instance Receiver: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... s3 = Group') - ReducedExpression: IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generic.IEnumerable(Of )>)) (Syntax: 'From s1 In ... s3 = Group') - LastClauseOrContinuation: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause) (Syntax: 'Group Join ... s3 = Group') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupJoin(Of , System.Int32, )>)(inner As System.Collections.Generic.IEnumerable(Of ), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of , System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ), )>)) As System.Collections.Generic.IEnumerable(Of )>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )>)) (Syntax: 'Group Join ... s3 = Group') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Dim expectedOperationTree = )>)) (Syntax: 'From s1 In ... s3 = Group') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of )>).Select(Of )>)(selector As System.Func(Of )>, )>)) As System.Collections.Generic.IEnumerable(Of )>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )>)) (Syntax: 'From s1 In ... s3 = Group') + Instance Receiver: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: System.Collections.Generic.IEnumerable(Of )>)) (Syntax: 'From s1 In ... s3 = Group') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).GroupJoin(Of , System.Int32, )>)(inner As System.Collections.Generic.IEnumerable(Of ), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of , System.Int32), resultSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ), )>)) As System.Collections.Generic.IEnumerable(Of )>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )>)) (Syntax: 'Group Join ... s3 = Group') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's1 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'Join ... 2 Equals s4') + IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join ... 2 Equals s4') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join ... 2 Equals s3') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New Integer() {1}') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From s1 In ... teger() {1}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's3 In New Integer() {1}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') Element Values(1): ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - Arguments(4): - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 'Join ... 2 Equals s4') - IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join ... 2 Equals s4') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of , System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join ... 2 Equals s4') - Instance Receiver: IJoinQueryClause (Clause kind: JoinClause) (OperationKind.QueryClause) (Syntax: 'Join ... 2 Equals s3') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Join(Of System.Int32, System.Int32, )(inner As System.Collections.Generic.IEnumerable(Of System.Int32), outerKeySelector As System.Func(Of System.Int32, System.Int32), innerKeySelector As System.Func(Of System.Int32, System.Int32), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Join ... 2 Equals s3') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's2 In New Integer() {1}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') - Element Values(1): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - Arguments(4): - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's3 In New Integer() {1}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's3 In New Integer() {1}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') - Element Values(1): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's3') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's3') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's3') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join ... 2 Equals s3') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join ... 2 Equals s3') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join ... 2 Equals s3') - Initializers(2): - IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2') - IParameterReferenceExpression: s3 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's3') - InConversion: null - OutConversion: null - Arguments(4): - IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's4 In New Integer() {1}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's4 In New Integer() {1}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') - Element Values(1): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's2') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's4') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's4') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's4') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join ... 2 Equals s4') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join ... 2 Equals s4') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join ... 2 Equals s4') - Initializers(3): - IOperation: (OperationKind.None) (Syntax: 's2') - IOperation: (OperationKind.None) (Syntax: 's3') - IOperation: (OperationKind.None) (Syntax: 's4') - InConversion: null - OutConversion: null InConversion: null OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's2') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's1') + Operand: ILambdaExpression (Signature: Function (s2 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2') + ReturnedValue: IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2') InConversion: null OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's2') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's3') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 's2') + Operand: ILambdaExpression (Signature: Function (s3 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's3') + ReturnedValue: IParameterReferenceExpression: s3 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's3') InConversion: null OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... s3 = Group') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ), )>)) (Syntax: 'Group Join ... s3 = Group') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join ... 2 Equals s3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Join ... 2 Equals s3') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: )>) (Syntax: 'Group Join ... s3 = Group') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group') - Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... s3 = Group') + Operand: ILambdaExpression (Signature: Function (s2 As System.Int32, s3 As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Join ... 2 Equals s3') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Join ... 2 Equals s3') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Join ... 2 Equals s3') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join ... 2 Equals s3') + Initializers(2): + IParameterReferenceExpression: s2 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's2') + IParameterReferenceExpression: s3 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's3') InConversion: null OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'From s1 In ... s3 = Group') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of )>, )>)) (Syntax: 'From s1 In ... s3 = Group') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: )>) (Syntax: 's1') - InConversion: null - OutConversion: null + Arguments(4): + IArgument (ArgumentKind.Explicit, Matching Parameter: inner) (OperationKind.Argument) (Syntax: 's4 In New Integer() {1}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 's4 In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2') + ReturnedValue: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2') + Arguments(0) + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's4') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's4') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s4 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's4') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's4') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's4') + ReturnedValue: IParameterReferenceExpression: s4 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's4') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Join ... 2 Equals s4') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Join ... 2 Equals s4') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It1 As , s4 As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Join ... 2 Equals s4') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Join ... 2 Equals s4') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Join ... 2 Equals s4') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join ... 2 Equals s4') + Initializers(3): + IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Join ... 2 Equals s4') + Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Join ... 2 Equals s4') + Arguments(0) + IInvocationExpression ( Function .get_s3() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Join ... 2 Equals s4') + Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Join ... 2 Equals s4') + Arguments(0) + IParameterReferenceExpression: s4 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Join ... 2 Equals s4') + InConversion: null + OutConversion: null + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: outerKeySelector) (OperationKind.Argument) (Syntax: 's1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 's2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 's2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2') + ReturnedValue: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2') + Arguments(0) + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... s3 = Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ), )>)) (Syntax: 'Group Join ... s3 = Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As System.Int32, $VB$ItAnonymous As System.Collections.Generic.IEnumerable(Of )) As )>) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Group Join ... s3 = Group') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Group Join ... s3 = Group') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group Join ... s3 = Group') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: )>) (Syntax: 'Group Join ... s3 = Group') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Group Join ... s3 = Group') + IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group Join ... s3 = Group') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'From s1 In ... s3 = Group') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of )>, )>)) (Syntax: 'From s1 In ... s3 = Group') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (s1 As )>) As )>) (OperationKind.LambdaExpression, Type: null) (Syntax: 'From s1 In ... s3 = Group') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'From s1 In ... s3 = Group') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'From s1 In ... s3 = Group') + ReturnedValue: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: )>) (Syntax: 's1') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -10537,6 +10837,7 @@ BC36631: 'Join' expected. ) End Sub + Public Sub GroupJoin5() Dim source = .Value -Dim expectedOperationTree = ), IsInvalid) (Syntax: 'From s1 In ... Into Group') - LastClauseOrContinuation: IGroupJoinQueryClause (Clause kind: GroupJoinClause) (OperationKind.QueryClause, IsInvalid) (Syntax: 'Group Join ... Into Group') - ReducedExpression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble(Of ), IsInvalid) (Syntax: 'Group Join ... Into Group') - Children(5): - IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Group Join ... Into Group') - ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble(Of System.Int32)) (Syntax: 'q') - IOperation: (OperationKind.None) (Syntax: 's1') - IOperation: (OperationKind.None) (Syntax: 't1') - IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , IsInvalid) (Syntax: 'Group Join ... Into Group') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 's1') - IAggregationExpression (Aggregation Kind: Group) (OperationKind.AggregationExpression, Type: ?) (Syntax: 'Group') - Expression: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: ?, IsInvalid) (Syntax: 'Group Join ... Into Group') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: QueryAble(Of ), IsInvalid) (Syntax: 'From s1 In ... Into Group') + Expression: IInvalidExpression (OperationKind.InvalidExpression, Type: QueryAble(Of ), IsInvalid) (Syntax: 'Group Join ... Into Group') + Children(5): + IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Group Join ... Into Group') + ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble(Of System.Int32)) (Syntax: 'q') + ILambdaExpression (Signature: Function (s1 As System.Int32) As ?) (OperationKind.LambdaExpression, Type: null) (Syntax: 's1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') + ReturnedValue: IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's1') + ILambdaExpression (Signature: Function (t1 As System.Int32) As ?) (OperationKind.LambdaExpression, Type: null) (Syntax: 't1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 't1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 't1') + ReturnedValue: IParameterReferenceExpression: t1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 't1') + ILambdaExpression (Signature: Function (s1 As System.Int32, $VB$ItAnonymous As ?) As ) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'Group Join ... Into Group') + IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'Group Join ... Into Group') + IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'Group Join ... Into Group') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , IsInvalid) (Syntax: 'Group Join ... Into Group') + Initializers(2): + IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'Group Join ... Into Group') + IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: ?, IsInvalid) (Syntax: 'Group Join ... Into Group') ]]>.Value Dim expectedDiagnostics = ) End Sub + Public Sub AggregateClause_IOperation() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty @@ -10756,6 +11063,7 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Int32) (Syntax: 'A VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub AggregateClause_MultipleAggregations_IOperation() Dim source = .Value Dim expectedOperationTree = ) (Syntax: 'Aggregate y ... Sum(y \ 2)') - LastClauseOrContinuation: IAggregateQueryClause (Clause kind: AggregateClause) (OperationKind.QueryClause) (Syntax: 'Aggregate y ... Sum(y \ 2)') - ReducedExpression: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Aggregate y ... Sum(y \ 2)') - Initializers(2): - IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Count()') - Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Aggregate y ... Sum(y \ 2)') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IPlaceholderExpression (OperationKind.PlaceholderExpression, Type: System.Int32()) (Syntax: 'Aggregate y ... Sum(y \ 2)') - Arguments(0) - IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Int32) (Syntax: 'Sum(y \ 2)') - Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Sum(selector As System.Func(Of System.Int32, System.Int32)) As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Sum(y \ 2)') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Aggregate y ... Sum(y \ 2)') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IPlaceholderExpression (OperationKind.PlaceholderExpression, Type: System.Int32()) (Syntax: 'Aggregate y ... Sum(y \ 2)') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'y \ 2') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'y \ 2') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'y \ 2') - Left: IOperation: (OperationKind.None) (Syntax: 'y') + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Expression: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Initializers(2): + IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IPlaceholderExpression (OperationKind.PlaceholderExpression, Type: System.Int32()) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Arguments(0) + IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Sum(selector As System.Func(Of System.Int32, System.Int32)) As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Sum(y \ 2)') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IPlaceholderExpression (OperationKind.PlaceholderExpression, Type: System.Int32()) (Syntax: 'Aggregate y ... Sum(y \ 2)') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'y \ 2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'y \ 2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (y As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 'y \ 2') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'y \ 2') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'y \ 2') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerDivide) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'y \ 2') + Left: IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'y \ 2') Right: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - InConversion: null - OutConversion: null + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -10807,6 +11115,7 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub AggregateClause_WithWhereFilter_IOperation() Dim source = .Value -Dim expectedOperationTree = ).Sum(selector As System.Func(Of , System.Int32)) As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Sum(x + y)') - Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where x > y') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Where(predicate As System.Func(Of , System.Boolean)) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where x > y') - Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'y In New In ... er() {1, 3}') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New In ... er() {3, 4}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3, 4}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {3, 4}') - Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{3, 4}') - Element Values(2): - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') - Arguments(2): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {1, 3}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {1, 3}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New In ... er() {1, 3}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 3}') - Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 3}') - Element Values(2): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Sum(x + y)') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Sum(x + y)') + Dim expectedOperationTree = ).Sum(selector As System.Func(Of , System.Int32)) As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Sum(x + y)') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Where(predicate As System.Func(Of , System.Boolean)) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where x > y') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'y In New In ... er() {1, 3}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New In ... er() {3, 4}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3, 4}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {3, 4}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{3, 4}') + Element Values(2): + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {1, 3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {1, 3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (x As System.Int32) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.LambdaExpression, Type: null) (Syntax: 'New Integer() {1, 3}') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'New Integer() {1, 3}') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'New Integer() {1, 3}') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New In ... er() {1, 3}') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'y In New In ... er() {1, 3}') - Initializers(2): - IOperation: (OperationKind.None) (Syntax: 'x') - IOperation: (OperationKind.None) (Syntax: 'y') - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'x > y') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'x > y') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'x > y') - Left: IOperation: (OperationKind.None) (Syntax: 'x') - Right: IOperation: (OperationKind.None) (Syntax: 'y') - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + y') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 'x + y') + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1, 3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {1, 3}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{1, 3}') + Element Values(2): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Sum(x + y)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Sum(x + y)') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') - Left: IOperation: (OperationKind.None) (Syntax: 'x') - Right: IOperation: (OperationKind.None) (Syntax: 'y') + Operand: ILambdaExpression (Signature: Function (x As System.Int32, y As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Aggregate x ... Sum(x + y)') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Aggregate x ... Sum(x + y)') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Aggregate x ... Sum(x + y)') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'y In New In ... er() {1, 3}') + Initializers(2): + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Aggregate x ... Sum(x + y)') + IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Aggregate x ... Sum(x + y)') InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'x > y') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'x > y') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x > y') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x > y') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x > y') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'x > y') + Left: IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x > y') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x > y') + Arguments(0) + Right: IInvocationExpression ( Function .get_y() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x > y') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x > y') + Arguments(0) + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + y') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32)) (Syntax: 'x + y') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') + Left: IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y') + Arguments(0) + Right: IInvocationExpression ( Function .get_y() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y') + Arguments(0) + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -10890,6 +11216,7 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Int32) (Syntax: 'A VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub AggregateClause_MultipleRangeVariableDeclarations_IOperation() Dim source = .Value -Dim expectedOperationTree = )) (Syntax: 'Aggregate x ... Where(True)') - LastClauseOrContinuation: IAggregateQueryClause (Clause kind: AggregateClause) (OperationKind.QueryClause) (Syntax: 'Aggregate x ... Where(True)') - ReducedExpression: IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') - Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Where(predicate As System.Func(Of , System.Boolean)) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') - Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'z In New Integer() {3}') - Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'y In New Integer() {2}') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New Integer() {1}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') - Element Values(1): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - Arguments(2): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {2}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {2}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New Integer() {2}') + Dim expectedOperationTree = )) (Syntax: 'Aggregate x ... Where(True)') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Where(predicate As System.Func(Of , System.Boolean)) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of , System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'z In New Integer() {3}') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'y In New Integer() {2}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {2}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {2}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (x As System.Int32) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.LambdaExpression, Type: null) (Syntax: 'New Integer() {2}') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'New Integer() {2}') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'New Integer() {2}') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New Integer() {2}') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2}') Dimension Sizes(1): @@ -10936,22 +11264,28 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{2}') Element Values(1): ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'y In New Integer() {2}') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (x As System.Int32, y As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Aggregate x ... Where(True)') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Aggregate x ... Where(True)') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Aggregate x ... Where(True)') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'y In New Integer() {2}') Initializers(2): IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'y') - InConversion: null - OutConversion: null - Arguments(2): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {3}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {3}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'z In New Integer() {3}') + InConversion: null + OutConversion: null + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.LambdaExpression, Type: null) (Syntax: 'New Integer() {3}') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'New Integer() {3}') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'New Integer() {3}') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'z In New Integer() {3}') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3}') Dimension Sizes(1): @@ -10959,25 +11293,35 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{3}') Element Values(1): ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'z In New Integer() {3}') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It1 As , z As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Aggregate x ... Where(True)') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Aggregate x ... Where(True)') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Aggregate x ... Where(True)') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'z In New Integer() {3}') Initializers(3): - IOperation: (OperationKind.None) (Syntax: 'x') - IOperation: (OperationKind.None) (Syntax: 'y') - IOperation: (OperationKind.None) (Syntax: 'z') - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'True') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') - InConversion: null - OutConversion: null + IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Aggregate x ... Where(True)') + Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Aggregate x ... Where(True)') + Arguments(0) + IInvocationExpression ( Function .get_y() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Aggregate x ... Where(True)') + Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Aggregate x ... Where(True)') + Arguments(0) + IParameterReferenceExpression: z (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Aggregate x ... Where(True)') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'True') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 'True') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'True') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'True') + ReturnedValue: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -10985,6 +11329,7 @@ IQueryExpression (OperationKind.QueryExpression, Type: System.Collections.Generi VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + Public Sub AggregateClause_WithDifferentClauses_IOperation() Dim source = .Value -Dim expectedOperationTree = ))) (Syntax: 'From x In N ... Where(True)') - LastClauseOrContinuation: IAggregateQueryClause (Clause kind: AggregateClause) (OperationKind.QueryClause) (Syntax: 'Aggregate x ... Where(True)') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of System.Collections.Generic.IEnumerable(Of ))(selector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ))) As System.Collections.Generic.IEnumerable(Of System.Collections.Generic.IEnumerable(Of ))) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Collections.Generic.IEnumerable(Of ))) (Syntax: 'Aggregate x ... Where(True)') - Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select x + 1') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of System.Int32)(selector As System.Func(Of System.Int32, System.Int32)) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Select x + 1') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New In ... er() {3, 4}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IFromQueryClause (Clause kind: FromClause) (OperationKind.QueryClause) (Syntax: 'From x In N ... er() {3, 4}') - ReducedExpression: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3, 4}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {3, 4}') - Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{3, 4}') - Element Values(2): - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + 1') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'x + 1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + 1') - Left: IOperation: (OperationKind.None) (Syntax: 'x') - Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - InConversion: null - OutConversion: null + Dim expectedOperationTree = ))) (Syntax: 'From x In N ... Where(True)') + Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of System.Collections.Generic.IEnumerable(Of ))(selector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ))) As System.Collections.Generic.IEnumerable(Of System.Collections.Generic.IEnumerable(Of ))) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Collections.Generic.IEnumerable(Of ))) (Syntax: 'Aggregate x ... Where(True)') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).Select(Of System.Int32)(selector As System.Func(Of System.Int32, System.Int32)) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Select x + 1') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New In ... er() {3, 4}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3, 4}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {3, 4}') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{3, 4}') + Element Values(2): + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'New Integer() {1}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ))) (Syntax: 'New Integer() {1}') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32)) (Syntax: 'x + 1') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAggregationExpression (Aggregation Kind: Function) (OperationKind.AggregationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') - Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Where(predicate As System.Func(Of , System.Boolean)) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') - Instance Receiver: ILetQueryClause (Clause kind: LetClause) (OperationKind.QueryClause) (Syntax: 'Let w = x + y + z') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Select(Of )(selector As System.Func(Of , )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'w = x + y + z') - Instance Receiver: ISelectQueryClause (Clause kind: SelectClause) (OperationKind.QueryClause) (Syntax: 'Select x, y, z') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Select(Of )(selector As System.Func(Of , Key z As System.Int32>, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Select x, y, z') - Instance Receiver: ITakeQueryClause (Clause kind: TakeClause) (OperationKind.QueryClause) (Syntax: 'Take 100') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Take(count As System.Int32) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Take 100') - Instance Receiver: ISkipQueryClause (Clause kind: SkipClause) (OperationKind.QueryClause) (Syntax: 'Skip 0') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Skip(count As System.Int32) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Skip 0') - Instance Receiver: ISkipWhileQueryClause (Clause kind: SkipWhileClause) (OperationKind.QueryClause) (Syntax: 'Skip While False') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).SkipWhile(predicate As System.Func(Of , Key z As System.Int32>, System.Boolean)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Skip While False') - Instance Receiver: ITakeWhileQueryClause (Clause kind: TakeWhileClause) (OperationKind.QueryClause) (Syntax: 'Take While True') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).TakeWhile(predicate As System.Func(Of , Key z As System.Int32>, System.Boolean)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Take While True') - Instance Receiver: IDistinctQueryClause (Clause kind: DistinctClause) (OperationKind.QueryClause) (Syntax: 'Distinct') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Distinct() As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Distinct') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Order By x') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOrderByQueryClause (Clause kind: OrderByClause) (OperationKind.QueryClause) (Syntax: 'Order By x') - ReducedExpression: IOrderingExpression (Order kind: Ascending) (OperationKind.OrderingExpression, Type: System.Linq.IOrderedEnumerable(Of , Key z As System.Int32>)) (Syntax: 'x') - Expression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).OrderBy(Of System.Int32)(keySelector As System.Func(Of , Key z As System.Int32>, System.Int32)) As System.Linq.IOrderedEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Linq.IOrderedEnumerable(Of , Key z As System.Int32>)) (Syntax: 'x') - Instance Receiver: IWhereQueryClause (Clause kind: WhereClause) (OperationKind.QueryClause) (Syntax: 'Where True') - ReducedExpression: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Where(predicate As System.Func(Of , Key z As System.Int32>, System.Boolean)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Where True') - Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).SelectMany(Of System.Int32, , Key z As System.Int32>)(collectionSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of , System.Int32, , Key z As System.Int32>)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'z In New Integer() {3}') - Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'y In New Integer() {2}') - Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New Integer() {1}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') - Element Values(1): - ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - Arguments(2): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {2}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {2}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New Integer() {2}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {2}') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{2}') - Element Values(1): - ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'y In New Integer() {2}') - Initializers(2): - IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') - IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'y') - InConversion: null - OutConversion: null - Arguments(2): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {3}') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {3}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'z In New Integer() {3}') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3}') - Dimension Sizes(1): - ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {3}') - Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{3}') - Element Values(1): - ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') - InConversion: null - OutConversion: null - IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, , Key z As System.Int32>)) (Syntax: 'Aggregate x ... Where(True)') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , Key z As System.Int32>) (Syntax: 'z In New Integer() {3}') - Initializers(2): - IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'z In New Integer() {3}') - IParameterReferenceExpression: z (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'z') - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'True') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'x') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Int32)) (Syntax: 'x') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IOperation: (OperationKind.None) (Syntax: 'x') - InConversion: null - OutConversion: null - Arguments(0) - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'True') + Operand: ILambdaExpression (Signature: Function (x As System.Int32) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + 1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + 1') + Left: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x + 1') + Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'New Integer() {1}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of ))) (Syntax: 'New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$ItAnonymous As System.Int32) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.LambdaExpression, Type: null) (Syntax: 'New Integer() {1}') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'New Integer() {1}') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'New Integer() {1}') + ReturnedValue: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Where(predicate As System.Func(Of , System.Boolean)) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Where(True)') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Select(Of )(selector As System.Func(Of , )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'w = x + y + z') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Select(Of )(selector As System.Func(Of , Key z As System.Int32>, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Select x, y, z') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Take(count As System.Int32) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Take 100') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Skip(count As System.Int32) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Skip 0') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).SkipWhile(predicate As System.Func(Of , Key z As System.Int32>, System.Boolean)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Skip While False') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).TakeWhile(predicate As System.Func(Of , Key z As System.Int32>, System.Boolean)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Take While True') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Distinct() As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Distinct') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Order By x') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).OrderBy(Of System.Int32)(keySelector As System.Func(Of , Key z As System.Int32>, System.Int32)) As System.Linq.IOrderedEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Linq.IOrderedEnumerable(Of , Key z As System.Int32>)) (Syntax: 'x') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>).Where(predicate As System.Func(Of , Key z As System.Int32>, System.Boolean)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'Where True') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).SelectMany(Of System.Int32, , Key z As System.Int32>)(collectionSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of , System.Int32, , Key z As System.Int32>)) As System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of , Key z As System.Int32>)) (Syntax: 'z In New Integer() {3}') + Instance Receiver: IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.Int32).SelectMany(Of System.Int32, )(collectionSelector As System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32)), resultSelector As System.Func(Of System.Int32, System.Int32, )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'y In New Integer() {2}') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'x In New Integer() {1}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {1}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {1}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{1}') + Element Values(1): + ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {2}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {2}') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') + Operand: ILambdaExpression (Signature: Function (x As System.Int32) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.LambdaExpression, Type: null) (Syntax: 'New Integer() {2}') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'New Integer() {2}') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'New Integer() {2}') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'y In New Integer() {2}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {2}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{2}') + Element Values(1): + ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Int32, )) (Syntax: 'Aggregate x ... Where(True)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function (x As System.Int32, y As System.Int32) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Aggregate x ... Where(True)') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Aggregate x ... Where(True)') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Aggregate x ... Where(True)') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'y In New Integer() {2}') + Initializers(2): + IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') + IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'y') InConversion: null OutConversion: null + Arguments(2): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: collectionSelector) (OperationKind.Argument) (Syntax: 'New Integer() {3}') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.Int32))) (Syntax: 'New Integer() {3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.LambdaExpression, Type: null) (Syntax: 'New Integer() {3}') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'New Integer() {3}') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'New Integer() {3}') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'z In New Integer() {3}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {3}') + Dimension Sizes(1): + ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'New Integer() {3}') + Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: '{3}') + Element Values(1): + ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Aggregate x ... Where(True)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Int32, , Key z As System.Int32>)) (Syntax: 'Aggregate x ... Where(True)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It1 As , z As System.Int32) As , Key z As System.Int32>) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Aggregate x ... Where(True)') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Aggregate x ... Where(True)') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Aggregate x ... Where(True)') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , Key z As System.Int32>) (Syntax: 'z In New Integer() {3}') + Initializers(2): + IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'z In New Integer() {3}') + IParameterReferenceExpression: z (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'z') + InConversion: null + OutConversion: null Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'False') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'False') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'True') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILiteralExpression (Text: False) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: False) (Syntax: 'False') + Operand: ILambdaExpression (Signature: Function ($VB$It As , Key z As System.Int32>) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 'True') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'True') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'True') + ReturnedValue: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') InConversion: null OutConversion: null - Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: count) (OperationKind.Argument) (Syntax: '0') - ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') - InConversion: null - OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'x') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Int32)) (Syntax: 'x') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As , Key z As System.Int32>) As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x') + ReturnedValue: IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x') + Instance Receiver: IInvocationExpression ( Function , Key z As System.Int32>.get_$VB$It1() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 'x') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key z As System.Int32>) (Syntax: 'x') + Arguments(0) + Arguments(0) + InConversion: null + OutConversion: null + Arguments(0) Arguments(1): - IArgument (ArgumentKind.Explicit, Matching Parameter: count) (OperationKind.Argument) (Syntax: '100') - ILiteralExpression (Text: 100) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 100) (Syntax: '100') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'True') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As , Key z As System.Int32>) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 'True') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'True') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'True') + ReturnedValue: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'False') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, System.Boolean)) (Syntax: 'False') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As , Key z As System.Int32>) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 'False') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'False') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'False') + ReturnedValue: ILiteralExpression (Text: False) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: False) (Syntax: 'False') + InConversion: null + OutConversion: null Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, )) (Syntax: 'x') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Select x, y, z') - Initializers(3): - IOperation: (OperationKind.None) (Syntax: 'x') - IOperation: (OperationKind.None) (Syntax: 'y') - IOperation: (OperationKind.None) (Syntax: 'z') + IArgument (ArgumentKind.Explicit, Matching Parameter: count) (OperationKind.Argument) (Syntax: '0') + ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.Explicit, Matching Parameter: count) (OperationKind.Argument) (Syntax: '100') + ILiteralExpression (Text: 100) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 100) (Syntax: '100') + InConversion: null + OutConversion: null Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + y + z') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , )) (Syntax: 'x + y + z') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , Key z As System.Int32>, )) (Syntax: 'x') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'w = x + y + z') - Initializers(4): - IOperation: (OperationKind.None) (Syntax: 'x') - IOperation: (OperationKind.None) (Syntax: 'y') - IOperation: (OperationKind.None) (Syntax: 'z') - IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y + z') - Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') - Left: IOperation: (OperationKind.None) (Syntax: 'x') - Right: IOperation: (OperationKind.None) (Syntax: 'y') - Right: IOperation: (OperationKind.None) (Syntax: 'z') + Operand: ILambdaExpression (Signature: Function ($VB$It As , Key z As System.Int32>) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Select x, y, z') + Initializers(3): + IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x') + Instance Receiver: IInvocationExpression ( Function , Key z As System.Int32>.get_$VB$It1() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 'x') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key z As System.Int32>) (Syntax: 'x') + Arguments(0) + Arguments(0) + IInvocationExpression ( Function .get_y() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x') + Instance Receiver: IInvocationExpression ( Function , Key z As System.Int32>.get_$VB$It1() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 'x') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key z As System.Int32>) (Syntax: 'x') + Arguments(0) + Arguments(0) + IInvocationExpression ( Function , Key z As System.Int32>.get_z() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key z As System.Int32>) (Syntax: 'x') + Arguments(0) InConversion: null OutConversion: null + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'x + y + z') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , )) (Syntax: 'x + y + z') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As ) (OperationKind.LambdaExpression, Type: null) (Syntax: 'x + y + z') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y + z') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y + z') + ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'w = x + y + z') + Initializers(4): + IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y + z') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y + z') + Arguments(0) + IInvocationExpression ( Function .get_y() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y + z') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y + z') + Arguments(0) + IInvocationExpression ( Function .get_z() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y + z') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y + z') + Arguments(0) + IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y + z') + Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') + Left: IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y + z') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y + z') + Arguments(0) + Right: IInvocationExpression ( Function .get_y() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y + z') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y + z') + Arguments(0) + Right: IInvocationExpression ( Function .get_z() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y + z') + Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y + z') + Arguments(0) + InConversion: null + OutConversion: null Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: predicate) (OperationKind.Argument) (Syntax: 'True') IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Boolean)) (Syntax: 'True') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') + Operand: ILambdaExpression (Signature: Function ($VB$It As ) As System.Boolean) (OperationKind.LambdaExpression, Type: null) (Syntax: 'True') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'True') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'True') + ReturnedValue: ILiteralExpression (Text: True) (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'True') InConversion: null OutConversion: null - InConversion: null - OutConversion: null + InConversion: null + OutConversion: null ]]>.Value Dim expectedDiagnostics = String.Empty @@ -11460,6 +11856,7 @@ BC36617: Aggregate function name cannot be used with a type character. ) End Sub + Public Sub Aggregate2b() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = Public Sub Aggregate2c() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = Date: Tue, 5 Sep 2017 10:32:32 -0700 Subject: [PATCH 4/8] Fix build break --- .../VisualBasicOperationFactory_QueryLambdaRewriter.vb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb index 639c690ce5afc..81002291a4770 100644 --- a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb +++ b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb @@ -65,9 +65,9 @@ Namespace Microsoft.CodeAnalysis.Semantics _uniqueNodes = New HashSet(Of BoundExpression) End Sub - Private Function HandleNode(Of T As BoundExpression)(node As T) As T + Private Function HandleNode(Of T As BoundExpression)(node As T, cloneNode As Func(Of T, T)) As T If Not _uniqueNodes.Add(node) Then - node = node.MemberwiseClone(Of T) + node = cloneNode(node) _uniqueNodes.Add(node) End If @@ -76,17 +76,17 @@ Namespace Microsoft.CodeAnalysis.Semantics Public Overrides Function VisitParameter(node As BoundParameter) As BoundNode node = DirectCast(MyBase.VisitParameter(node), BoundParameter) - Return HandleNode(node) + Return HandleNode(node, cloneNode:=Function(n) New BoundParameter(node.Syntax, node.ParameterSymbol, node.IsLValue, node.SuppressVirtualCalls, node.Type, node.HasErrors)) End Function Public Overrides Function VisitCall(node As BoundCall) As BoundNode node = DirectCast(MyBase.VisitCall(node), BoundCall) - Return HandleNode(node) + Return HandleNode(node, cloneNode:=Function(n) New BoundCall(node.Syntax, node.Method, node.MethodGroupOpt, node.ReceiverOpt, node.Arguments, node.ConstantValueOpt, node.IsLValue, node.SuppressObjectClone, node.Type, node.HasErrors)) End Function Public Overrides Function VisitPropertyAccess(node As BoundPropertyAccess) As BoundNode node = DirectCast(MyBase.VisitPropertyAccess(node), BoundPropertyAccess) - Return HandleNode(node) + Return HandleNode(node, cloneNode:=Function(n) New BoundPropertyAccess(node.Syntax, node.PropertySymbol, node.PropertyGroupOpt, node.AccessKind, node.IsWriteable, node.IsLValue, node.ReceiverOpt, node.Arguments, node.Type, node.HasErrors)) End Function End Class End Class From 8732a4ed1ecad9544f0f9e0812a111cf22525b7a Mon Sep 17 00:00:00 2001 From: Manish Vasani Date: Tue, 12 Sep 2017 13:48:20 -0700 Subject: [PATCH 5/8] Address PR feedback --- .../Test/Semantic/Semantics/QueryTests.cs | 94 ++++ .../Generated/Operations.xml.Generated.cs | 21 +- .../Operations/ITranslatedQueryExpression.cs | 7 +- .../LocalRewriter/LocalRewriter_Query.vb | 56 +- ...sicOperationFactory_QueryLambdaRewriter.vb | 54 +- ...tionTests_IParameterReferenceExpression.vb | 6 +- .../Semantic/Semantics/QueryExpressions.vb | 507 +++++++++--------- 7 files changed, 418 insertions(+), 327 deletions(-) diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs index 2106676c0a985..9175930d7c46a 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs @@ -3958,5 +3958,99 @@ Element Values(1): VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } + + [CompilerTrait(CompilerFeature.IOperation)] + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void IOperationForQueryClause() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c = new List() { 1, 2, 3, 4, 5, 6, 7 }; + var r = from i in c /**/select i + 1/**/; + } +} +"; + string expectedOperationTree = @" +IInvocationExpression (System.Collections.Generic.IEnumerable System.Linq.Enumerable.Select(this System.Collections.Generic.IEnumerable source, System.Func selector)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'select i + 1') + Instance Receiver: null + Arguments(2): + IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from i in c') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from i in c') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') + InConversion: null + OutConversion: null + IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'i + 1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'i + 1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IAnonymousFunctionExpression (Symbol: lambda expression) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: 'i + 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'i + 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'i + 1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperatorKind.Add) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'i + 1') + Left: IOperation: (OperationKind.None) (Syntax: 'i') + Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') + InConversion: null + OutConversion: null +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + + [CompilerTrait(CompilerFeature.IOperation)] + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void IOperationForRangeVariableDefinition() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c = new List() { 1, 2, 3, 4, 5, 6, 7 }; + var r = /**/from i in c/**/ select i + 1; + } +} +"; + string expectedOperationTree = @" +ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'c') +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + + [CompilerTrait(CompilerFeature.IOperation)] + [Fact, WorkItem(17838, "https://github.com/dotnet/roslyn/issues/17838")] + public void IOperationForRangeVariableReference() + { + string source = @" +using System.Collections.Generic; +using System.Linq; + +class Query +{ + public static void Main(string[] args) + { + List c = new List() { 1, 2, 3, 4, 5, 6, 7 }; + var r = from i in c select /**/i/**/ + 1; + } +} +"; + string expectedOperationTree = @" +IOperation: (OperationKind.None) (Syntax: 'i') +"; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } } } diff --git a/src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs b/src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs index 93a3bd23f8120..e56a81abb0c9a 100644 --- a/src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs +++ b/src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs @@ -5617,8 +5617,11 @@ public LazyCollectionElementInitializerExpression(IMethodSymbol addMethod, Lazy< /// /// Represents an unrolled/lowered query expression in C# and VB. - /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, - /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. + /// For example, for the query expression "from x in set where x.Name != null select x.Name", the Operation tree has the following shape: + /// ITranslatedQueryExpression + /// IInvocationExpression ('Select' invocation for "select x.Name") + /// IInvocationExpression ('Where' invocation for "where x.Name != null") + /// IInvocationExpression ('From' invocation for "from x in set") /// internal abstract partial class BaseTranslatedQueryExpression : Operation, ITranslatedQueryExpression { @@ -5650,8 +5653,11 @@ public override TResult Accept(OperationVisitor /// Represents an unrolled/lowered query expression in C# and VB. - /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, - /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. + /// For example, for the query expression "from x in set where x.Name != null select x.Name", the Operation tree has the following shape: + /// ITranslatedQueryExpression + /// IInvocationExpression ('Select' invocation for "select x.Name") + /// IInvocationExpression ('Where' invocation for "where x.Name != null") + /// IInvocationExpression ('From' invocation for "from x in set") /// internal sealed partial class TranslatedQueryExpression : BaseTranslatedQueryExpression, ITranslatedQueryExpression { @@ -5665,8 +5671,11 @@ public TranslatedQueryExpression(IOperation expression, SemanticModel semanticMo /// /// Represents an unrolled/lowered query expression in C# and VB. - /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, - /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. + /// For example, for the query expression "from x in set where x.Name != null select x.Name", the Operation tree has the following shape: + /// ITranslatedQueryExpression + /// IInvocationExpression ('Select' invocation for "select x.Name") + /// IInvocationExpression ('Where' invocation for "where x.Name != null") + /// IInvocationExpression ('From' invocation for "from x in set") /// internal sealed partial class LazyTranslatedQueryExpression : BaseTranslatedQueryExpression, ITranslatedQueryExpression { diff --git a/src/Compilers/Core/Portable/Operations/ITranslatedQueryExpression.cs b/src/Compilers/Core/Portable/Operations/ITranslatedQueryExpression.cs index 2add06935a3e4..99312f666e2c9 100644 --- a/src/Compilers/Core/Portable/Operations/ITranslatedQueryExpression.cs +++ b/src/Compilers/Core/Portable/Operations/ITranslatedQueryExpression.cs @@ -4,8 +4,11 @@ namespace Microsoft.CodeAnalysis.Semantics { /// /// Represents an unrolled/lowered query expression in C# and VB. - /// For example, for the query expression "from x in set where x.Name != null select x.Name", the select clause is the last clause of the unrolled query expression, - /// with the where clause as one of its descendant, and the from clause as the descendant of the where clause. + /// For example, for the query expression "from x in set where x.Name != null select x.Name", the Operation tree has the following shape: + /// ITranslatedQueryExpression + /// IInvocationExpression ('Select' invocation for "select x.Name") + /// IInvocationExpression ('Where' invocation for "where x.Name != null") + /// IInvocationExpression ('From' invocation for "from x in set") /// /// /// This interface is reserved for implementation by its associated APIs. We reserve the right to diff --git a/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb b/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb index e7ec42031faf9..fc6285313fbd5 100644 --- a/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb +++ b/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb @@ -49,7 +49,14 @@ Namespace Microsoft.CodeAnalysis.VisualBasic _instrumentTopLevelNonCompilerGeneratedExpressionsInQuery = Not instrumentQueryLambdaBody - Dim returnstmt = RewriteQueryLambdaBody(AddressOf VisitExpressionNode, node, _rangeVariableMap, _instrumenterOpt, instrumentQueryLambdaBody:=instrumentQueryLambdaBody AndAlso Instrument) + Dim rewrittenBody As BoundExpression = VisitExpressionNode(node.Expression) + Dim returnstmt = CreateReturnStatementForQueryLambdaBody(rewrittenBody, node) + + If instrumentQueryLambdaBody AndAlso Instrument Then + returnstmt = _instrumenterOpt.InstrumentQueryLambdaBody(node, returnstmt) + End If + + RemoveRangeVariables(node, _rangeVariableMap) _instrumentTopLevelNonCompilerGeneratedExpressionsInQuery = save_createSequencePointsForTopLevelNonCompilerGeneratedExpressions @@ -90,14 +97,18 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Dim paramRef As New BoundParameter(node.Syntax, parameter, False, - parameter.Type, - hasErrors:=parameter.Type.IsErrorType()) - - If Not paramRef.HasErrors AndAlso isReservedName AndAlso Not String.Equals(parameterName, StringConstants.Group, StringComparison.Ordinal) Then - ' Compound variable. - ' Each range variable is an Anonymous Type property. - Debug.Assert(parameterName.Equals(StringConstants.It) OrElse parameterName.Equals(StringConstants.It1) OrElse parameterName.Equals(StringConstants.It2)) - PopulateRangeVariableMapForAnonymousType(node.Syntax, paramRef, nodeRangeVariables, firstUnmappedRangeVariable, rangeVariableMap, inExpressionLambda) + parameter.Type) + + If isReservedName AndAlso Not String.Equals(parameterName, StringConstants.Group, StringComparison.Ordinal) Then + If parameter.Type.IsErrorType() Then + ' Skip adding to the range variable map for error case. + firstUnmappedRangeVariable += 1 + Else + ' Compound variable. + ' Each range variable is an Anonymous Type property. + Debug.Assert(parameterName.Equals(StringConstants.It) OrElse parameterName.Equals(StringConstants.It1) OrElse parameterName.Equals(StringConstants.It2)) + PopulateRangeVariableMapForAnonymousType(node.Syntax, paramRef, nodeRangeVariables, firstUnmappedRangeVariable, rangeVariableMap, inExpressionLambda) + End If Else ' Simple case, range variable is a lambda parameter. Debug.Assert(IdentifierComparison.Equals(parameterName, nodeRangeVariables(firstUnmappedRangeVariable).Name)) @@ -158,28 +169,21 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Next End Sub - Friend Shared Function RewriteQueryLambdaBody( - expressionRewriter As Func(Of BoundExpression, BoundExpression), - originalNode As BoundQueryLambda, - rangeVariableMap As Dictionary(Of RangeVariableSymbol, BoundExpression), - Optional instrumenterOpt As Instrumenter = Nothing, - Optional instrumentQueryLambdaBody As Boolean = False) As BoundStatement - - Dim returnstmt As BoundStatement = New BoundReturnStatement(originalNode.Syntax, - expressionRewriter(originalNode.Expression), - Nothing, - Nothing) + Friend Shared Function CreateReturnStatementForQueryLambdaBody( + rewrittenBody As BoundExpression, + originalNode As BoundQueryLambda) As BoundStatement - If instrumentQueryLambdaBody Then - returnstmt = instrumenterOpt.InstrumentQueryLambdaBody(originalNode, returnstmt) - End If + Return New BoundReturnStatement(originalNode.Syntax, + rewrittenBody, + Nothing, + Nothing) + End Function + Friend Shared Sub RemoveRangeVariables(originalNode As BoundQueryLambda, rangeVariableMap As Dictionary(Of RangeVariableSymbol, BoundExpression)) For Each rangeVar As RangeVariableSymbol In originalNode.RangeVariables rangeVariableMap.Remove(rangeVar) Next - - Return returnstmt - End Function + End Sub Friend Shared Function RewriteQueryLambda(rewrittenBody As BoundStatement, originalNode As BoundQueryLambda) As BoundLambda Dim lambdaBody = New BoundBlock(originalNode.Syntax, diff --git a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb index 81002291a4770..058edfcae0fa8 100644 --- a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb +++ b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb @@ -1,6 +1,7 @@ ' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.VisualBasic +Imports Microsoft.CodeAnalysis.VisualBasic.BoundTreeVisitor Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Namespace Microsoft.CodeAnalysis.Semantics @@ -9,11 +10,17 @@ Namespace Microsoft.CodeAnalysis.Semantics ' We rewrite query lambda into regular lambda with 2 passes. ' Pass 1 uses helper methods from LocalRewriter to do the lowering. This introduces large number of DAGs. ' Pass 2 walks over the lowered tree and replaces duplicate bound nodes in the tree with their clones - this is a requirement for the Operation tree. - Dim pass1Rewriter As New QueryLambdaRewriterPass1 - Dim rewrittenLambda As BoundLambda = DirectCast(pass1Rewriter.VisitQueryLambda(node), BoundLambda) + ' Note that the rewriter also rewrites all the query lambdas inside the body of this query lambda. - Dim pass2Rewriter As New QueryLambdaRewriterPass2 - Return pass2Rewriter.VisitLambda(rewrittenLambda) + Try + Dim pass1Rewriter As New QueryLambdaRewriterPass1 + Dim rewrittenLambda As BoundLambda = DirectCast(pass1Rewriter.VisitQueryLambda(node), BoundLambda) + + Dim pass2Rewriter As New QueryLambdaRewriterPass2 + Return pass2Rewriter.VisitLambda(rewrittenLambda) + Catch ex As CancelledByStackGuardException + Return node + End Try End Function Private NotInheritable Class QueryLambdaRewriterPass1 @@ -25,9 +32,11 @@ Namespace Microsoft.CodeAnalysis.Semantics End Sub Public Overrides Function VisitQueryLambda(node As BoundQueryLambda) As BoundNode - LocalRewriter.PopulateRangeVariableMapForQueryLambdaRewrite(node, _rangeVariableMap, inExpressionLambda:=False) - Dim rewrittenBody As BoundStatement = LocalRewriter.RewriteQueryLambdaBody(AddressOf VisitExpressionWithStackGuard, node, _rangeVariableMap) - Return LocalRewriter.RewriteQueryLambda(rewrittenBody, node) + LocalRewriter.PopulateRangeVariableMapForQueryLambdaRewrite(node, _rangeVariableMap, inExpressionLambda:=True) + Dim rewrittenBody As BoundExpression = VisitExpressionWithStackGuard(node.Expression) + Dim rewrittenStatement As BoundStatement = LocalRewriter.CreateReturnStatementForQueryLambdaBody(rewrittenBody, node) + LocalRewriter.RemoveRangeVariables(node, _rangeVariableMap) + Return LocalRewriter.RewriteQueryLambda(rewrittenStatement, node) End Function Public Overrides Function VisitRangeVariable(node As BoundRangeVariable) As BoundNode @@ -39,13 +48,12 @@ Namespace Microsoft.CodeAnalysis.Semantics End If #If DEBUG Then - ' Range variable reference should be rewritten to a parameter reference, or a call or a property access. + ' Range variable reference should be rewritten to a parameter reference or a property access. ' We clone these bound nodes in QueryLambdaRewriterPass2 to avoid dag in the generated bound tree. ' If the LocalRewriter is changed to generate more kind of bound nodes for range variables, we should handle these in QueryLambdaRewriterPass2. ' Below assert helps us to stay in sync with the LocalRewriter. Select Case expression.Kind Case BoundKind.Parameter - Case BoundKind.Call Case BoundKind.PropertyAccess Exit Select Case Else @@ -59,34 +67,16 @@ Namespace Microsoft.CodeAnalysis.Semantics Private NotInheritable Class QueryLambdaRewriterPass2 Inherits BoundTreeRewriterWithStackGuard - Private ReadOnly _uniqueNodes As HashSet(Of BoundExpression) - - Public Sub New() - _uniqueNodes = New HashSet(Of BoundExpression) - End Sub - - Private Function HandleNode(Of T As BoundExpression)(node As T, cloneNode As Func(Of T, T)) As T - If Not _uniqueNodes.Add(node) Then - node = cloneNode(node) - _uniqueNodes.Add(node) - End If - - Return node - End Function + Private ReadOnly _uniqueNodes As New HashSet(Of BoundParameter) Public Overrides Function VisitParameter(node As BoundParameter) As BoundNode node = DirectCast(MyBase.VisitParameter(node), BoundParameter) - Return HandleNode(node, cloneNode:=Function(n) New BoundParameter(node.Syntax, node.ParameterSymbol, node.IsLValue, node.SuppressVirtualCalls, node.Type, node.HasErrors)) - End Function - Public Overrides Function VisitCall(node As BoundCall) As BoundNode - node = DirectCast(MyBase.VisitCall(node), BoundCall) - Return HandleNode(node, cloneNode:=Function(n) New BoundCall(node.Syntax, node.Method, node.MethodGroupOpt, node.ReceiverOpt, node.Arguments, node.ConstantValueOpt, node.IsLValue, node.SuppressObjectClone, node.Type, node.HasErrors)) - End Function + If node.ParameterSymbol?.ContainingSymbol.IsQueryLambdaMethod AndAlso Not _uniqueNodes.Add(node) Then + node = New BoundParameter(node.Syntax, node.ParameterSymbol, node.IsLValue, node.SuppressVirtualCalls, node.Type, node.HasErrors) + End If - Public Overrides Function VisitPropertyAccess(node As BoundPropertyAccess) As BoundNode - node = DirectCast(MyBase.VisitPropertyAccess(node), BoundPropertyAccess) - Return HandleNode(node, cloneNode:=Function(n) New BoundPropertyAccess(node.Syntax, node.PropertySymbol, node.PropertyGroupOpt, node.AccessKind, node.IsWriteable, node.IsLValue, node.ReceiverOpt, node.Arguments, node.Type, node.HasErrors)) + Return node End Function End Class End Class diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb index 0ea0cff621e64..76fbeb98f6c4f 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb @@ -238,12 +238,10 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group By w ... nto Count()') ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By w ... nto Count()') Initializers(3): - IInvocationExpression ( Function .get_w() As System.String()) (OperationKind.InvocationExpression, Type: System.String()) (Syntax: 'Group By w ... nto Count()') + IPropertyReferenceExpression: ReadOnly Property .w As System.String() (OperationKind.PropertyReferenceExpression, Type: System.String()) (Syntax: 'Group By w ... nto Count()') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Group By w ... nto Count()') - Arguments(0) - IInvocationExpression ( Function .get_z() As System.String) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'Group By w ... nto Count()') + IPropertyReferenceExpression: ReadOnly Property .z As System.String (OperationKind.PropertyReferenceExpression, Type: System.String) (Syntax: 'Group By w ... nto Count()') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Group By w ... nto Count()') - Arguments(0) IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of System.String).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') Instance Receiver: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.String)) (Syntax: 'Group By w ... nto Count()') Arguments(0) diff --git a/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb b/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb index a117249146df9..e91743b38053f 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb @@ -238,74 +238,6 @@ Where System.Func`2[System.Int32,System.Boolean] End Sub - - - Public Sub WhereClause02_IOperation() - Dim source = 0 - System.Console.WriteLine("-----") - Dim q2 As Object = From s In q Where s > 0 Where 10 > s'BIND:"From s In q Where s > 0 Where 10 > s" - End Sub -End Module]]>.Value - - Dim expectedOperationTree = s') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) - Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: QueryAble) (Syntax: 'From s In q ... here 10 > s') - Expression: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where 10 > s') - Instance Receiver: IInvocationExpression ( Function QueryAble.Where(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble) (OperationKind.InvocationExpression, Type: QueryAble) (Syntax: 'Where s > 0') - Instance Receiver: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousFunctionExpression (Symbol: Function (s As System.Int32) As System.Boolean) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: 's > 0') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 0') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 0') - ReturnedValue: IBinaryOperatorExpression (BinaryOperatorKind.GreaterThan, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') - Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 0') - Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') - InConversion: null - OutConversion: null - Arguments(1): - IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10 > s') - IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: '10 > s') - Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: IAnonymousFunctionExpression (Symbol: Function (s As System.Int32) As System.Boolean) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: '10 > s') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '10 > s') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: '10 > s') - ReturnedValue: IBinaryOperatorExpression (BinaryOperatorKind.GreaterThan, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: '10 > s') - Left: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') - Right: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: '10 > s') - InConversion: null - OutConversion: null -]]>.Value - - Dim expectedDiagnostics = String.Empty - - VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) - End Sub - Public Sub Test4() @@ -2151,13 +2083,6 @@ Module Module1 Sub Main() Dim q As New QueryAble() - System.Console.WriteLine("-----") - Dim q1 As Object = From s In q Select t = s * 2 Select t - System.Console.WriteLine() - System.Console.WriteLine("-----") - Dim q2 As Object = From s In q Select s * 3 Where 100 Select -1 - System.Console.WriteLine() - System.Console.WriteLine("-----") Dim ind As New Index() Dim q3 As Object = From s In q'BIND:"From s In q" @@ -2169,9 +2094,6 @@ Module Module1 Where Num2 = -10 + Num1() Select ind!Two Where Two > 0 - - System.Console.WriteLine() - System.Console.WriteLine("-----") End Sub End Module]]>.Value @@ -3641,7 +3563,7 @@ BC42016: Implicit conversion from 'Boolean' to 'String'. - Public Sub While1() + Public Sub While1_TakeWhile() Dim source = 1 - Dim q2 As Object = From s In q Skip While s > 1 + Dim q1 As Object = From s In q Take While s > 1'BIND:"From s In q Take While s > 1" End Sub End Module]]>.Value Dim expectedOperationTree = 1') - IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'q1') - Variables: Local_1: q1 As System.Object - Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q ... While s > 1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'From s In q ... While s > 1') - Expression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Take While s > 1') - Children(2): - ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') - IAnonymousFunctionExpression (Symbol: Function (s As System.Int32) As ?) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: 's > 1') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 1') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 1') - ReturnedValue: IBinaryOperatorExpression (BinaryOperatorKind.GreaterThan, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 1') - Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 1') - Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Dim q2 As O ... While s > 1') - IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'q2') - Variables: Local_1: q2 As System.Object - Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q ... While s > 1') - Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) - Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'From s In q ... While s > 1') - Expression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Skip While s > 1') - Children(2): - ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') - IAnonymousFunctionExpression (Symbol: Function (s As System.Int32) As ?) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: 's > 1') - IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 1') - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 1') - ReturnedValue: IBinaryOperatorExpression (BinaryOperatorKind.GreaterThan, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 1') - Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 1') - Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - ILabeledStatement (Label: exit) (OperationKind.LabeledStatement) (Syntax: 'End Sub') - Statement: null - IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'End Sub') - ReturnedValue: null +IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'From s In q ... While s > 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'From s In q ... While s > 1') + Expression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Take While s > 1') + Children(2): + ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + IAnonymousFunctionExpression (Symbol: Function (s As System.Int32) As ?) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: 's > 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperatorKind.GreaterThan, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 1') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 1') + Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') ]]>.Value Dim expectedDiagnostics = 1 + Dim q1 As Object = From s In q Take While s > 1'BIND:"From s In q Take While s > 1" ~~~~~~~~~~ +]]>.Value + + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + + Public Sub While1_SkipWhile() + Dim source = 1'BIND:"From s In q Skip While s > 1" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = 1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: ?, IsInvalid) (Syntax: 'From s In q ... While s > 1') + Expression: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Skip While s > 1') + Children(2): + ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + IAnonymousFunctionExpression (Symbol: Function (s As System.Int32) As ?) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: 's > 1') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 1') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 1') + ReturnedValue: IBinaryOperatorExpression (BinaryOperatorKind.GreaterThan, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 1') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 1') + Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') +]]>.Value + + Dim expectedDiagnostics = 1 + Dim q2 As Object = From s In q Skip While s > 1'BIND:"From s In q Skip While s > 1" ~~~~~~~~~~ ]]>.Value - VerifyOperationTreeAndDiagnosticsForTest(Of MethodBlockSyntax)(source, expectedOperationTree, expectedDiagnostics) + VerifyOperationTreeAndDiagnosticsForTest(Of QueryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub @@ -5638,19 +5570,15 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2 + s1') ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's3 = s2 + s1') Initializers(3): - IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2 + s1') + IPropertyReferenceExpression: ReadOnly Property .s1 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's2 + s1') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2 + s1') - Arguments(0) - IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2 + s1') + IPropertyReferenceExpression: ReadOnly Property .s2 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's2 + s1') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2 + s1') - Arguments(0) IBinaryOperatorExpression (BinaryOperatorKind.Add, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 + s1') - Left: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2 + s1') + Left: IPropertyReferenceExpression: ReadOnly Property .s2 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's2 + s1') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2 + s1') - Arguments(0) - Right: IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2 + s1') + Right: IPropertyReferenceExpression: ReadOnly Property .s1 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's2 + s1') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2 + s1') - Arguments(0) InConversion: null OutConversion: null ]]>.Value @@ -5720,12 +5648,10 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve Initializers(2): IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's3 = s2 + s1') IBinaryOperatorExpression (BinaryOperatorKind.Add, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 + s1') - Left: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2 + s1') + Left: IPropertyReferenceExpression: ReadOnly Property .s2 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's2 + s1') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2 + s1') - Arguments(0) - Right: IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2 + s1') + Right: IPropertyReferenceExpression: ReadOnly Property .s1 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's2 + s1') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2 + s1') - Arguments(0) InConversion: null OutConversion: null Arguments(1): @@ -5740,19 +5666,14 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's4 = s1 + s2 + s3') IBinaryOperatorExpression (BinaryOperatorKind.Add, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') Left: IBinaryOperatorExpression (BinaryOperatorKind.Add, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2') - Left: IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') - Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>.get_$VB$It() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 's1 + s2 + s3') + Left: IPropertyReferenceExpression: ReadOnly Property .s1 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>.$VB$It As (OperationKind.PropertyReferenceExpression, Type: ) (Syntax: 's1 + s2 + s3') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3') - Arguments(0) - Arguments(0) - Right: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') - Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>.get_$VB$It() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 's1 + s2 + s3') + Right: IPropertyReferenceExpression: ReadOnly Property .s2 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>.$VB$It As (OperationKind.PropertyReferenceExpression, Type: ) (Syntax: 's1 + s2 + s3') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3') - Arguments(0) - Arguments(0) - Right: IInvocationExpression ( Function , Key s3 As System.Int32>.get_s3() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') + Right: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>.s3 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3') - Arguments(0) InConversion: null OutConversion: null Arguments(1): @@ -5764,53 +5685,35 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1 + s2 + s3 + s4') ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 's5 = s1 + s2 + s3 + s4') Initializers(5): - IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') - Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>.get_$VB$It() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 's1 + s2 + s3 + s4') - Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_$VB$It() As , Key s3 As System.Int32>) (OperationKind.InvocationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + IPropertyReferenceExpression: ReadOnly Property .s1 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>.$VB$It As (OperationKind.PropertyReferenceExpression, Type: ) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>, Key s4 As System.Int32>.$VB$It As , Key s3 As System.Int32> (OperationKind.PropertyReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') - Arguments(0) - Arguments(0) - Arguments(0) - IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') - Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>.get_$VB$It() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 's1 + s2 + s3 + s4') - Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_$VB$It() As , Key s3 As System.Int32>) (OperationKind.InvocationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + IPropertyReferenceExpression: ReadOnly Property .s2 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>.$VB$It As (OperationKind.PropertyReferenceExpression, Type: ) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>, Key s4 As System.Int32>.$VB$It As , Key s3 As System.Int32> (OperationKind.PropertyReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') - Arguments(0) - Arguments(0) - Arguments(0) - IInvocationExpression ( Function , Key s3 As System.Int32>.get_s3() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') - Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_$VB$It() As , Key s3 As System.Int32>) (OperationKind.InvocationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>.s3 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>, Key s4 As System.Int32>.$VB$It As , Key s3 As System.Int32> (OperationKind.PropertyReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') - Arguments(0) - Arguments(0) - IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_s4() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>, Key s4 As System.Int32>.s4 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') - Arguments(0) IBinaryOperatorExpression (BinaryOperatorKind.Add, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') Left: IBinaryOperatorExpression (BinaryOperatorKind.Add, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3') Left: IBinaryOperatorExpression (BinaryOperatorKind.Add, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + s2') - Left: IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') - Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>.get_$VB$It() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 's1 + s2 + s3 + s4') - Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_$VB$It() As , Key s3 As System.Int32>) (OperationKind.InvocationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Left: IPropertyReferenceExpression: ReadOnly Property .s1 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>.$VB$It As (OperationKind.PropertyReferenceExpression, Type: ) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>, Key s4 As System.Int32>.$VB$It As , Key s3 As System.Int32> (OperationKind.PropertyReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') - Arguments(0) - Arguments(0) - Arguments(0) - Right: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') - Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>.get_$VB$It() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 's1 + s2 + s3 + s4') - Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_$VB$It() As , Key s3 As System.Int32>) (OperationKind.InvocationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Right: IPropertyReferenceExpression: ReadOnly Property .s2 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>.$VB$It As (OperationKind.PropertyReferenceExpression, Type: ) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>, Key s4 As System.Int32>.$VB$It As , Key s3 As System.Int32> (OperationKind.PropertyReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') - Arguments(0) - Arguments(0) - Arguments(0) - Right: IInvocationExpression ( Function , Key s3 As System.Int32>.get_s3() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') - Instance Receiver: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_$VB$It() As , Key s3 As System.Int32>) (OperationKind.InvocationExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') + Right: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>.s3 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>, Key s4 As System.Int32>.$VB$It As , Key s3 As System.Int32> (OperationKind.PropertyReferenceExpression, Type: , Key s3 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') - Arguments(0) - Arguments(0) - Right: IInvocationExpression ( Function , Key s3 As System.Int32>, Key s4 As System.Int32>.get_s4() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') + Right: IPropertyReferenceExpression: ReadOnly Property , Key s3 As System.Int32>, Key s4 As System.Int32>.s4 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's1 + s2 + s3 + s4') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key s3 As System.Int32>, Key s4 As System.Int32>) (Syntax: 's1 + s2 + s3 + s4') - Arguments(0) InConversion: null OutConversion: null ]]>.Value @@ -7437,9 +7340,8 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's3') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's3') ReturnedValue: IBinaryOperatorExpression (BinaryOperatorKind.Multiply, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's2 * 2') - Left: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's3') + Left: IPropertyReferenceExpression: ReadOnly Property .s2 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's3') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's3') - Arguments(0) Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') InConversion: null OutConversion: null @@ -7460,12 +7362,10 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Join s3 In ... uals s2 * 2') ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s3 In ... uals s2 * 2') Initializers(3): - IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Join s3 In ... uals s2 * 2') + IPropertyReferenceExpression: ReadOnly Property .s1 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'Join s3 In ... uals s2 * 2') Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Join s3 In ... uals s2 * 2') - Arguments(0) - IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Join s3 In ... uals s2 * 2') + IPropertyReferenceExpression: ReadOnly Property .s2 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'Join s3 In ... uals s2 * 2') Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Join s3 In ... uals s2 * 2') - Arguments(0) IParameterReferenceExpression: s3 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Join s3 In ... uals s2 * 2') InConversion: null OutConversion: null @@ -8849,12 +8749,10 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group s1, s ... (), Max(s1)') ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ), Key c As System.Int32, Key Max As System.Int32>) (Syntax: 'Group s1, s ... (), Max(s1)') Initializers(5): - IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Group s1, s ... (), Max(s1)') + IPropertyReferenceExpression: ReadOnly Property .s1 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'Group s1, s ... (), Max(s1)') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Group s1, s ... (), Max(s1)') - Arguments(0) - IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Group s1, s ... (), Max(s1)') + IPropertyReferenceExpression: ReadOnly Property .s2 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'Group s1, s ... (), Max(s1)') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Group s1, s ... (), Max(s1)') - Arguments(0) IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1, s ... (), Max(s1)') IInvocationExpression ( Function System.Collections.Generic.IEnumerable(Of ).Count() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Count()') Instance Receiver: IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group s1, s ... (), Max(s1)') @@ -8868,9 +8766,8 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste Operand: IAnonymousFunctionExpression (Symbol: Function ($VB$It As ) As System.Int32) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: 's1') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's1') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's1') - ReturnedValue: IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's1') + ReturnedValue: IPropertyReferenceExpression: ReadOnly Property .s1 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's1') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's1') - Arguments(0) InConversion: null OutConversion: null InConversion: null @@ -8972,9 +8869,8 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste Operand: IAnonymousFunctionExpression (Symbol: Function ($VB$It As ) As System.Int32) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: 'key') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'key') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'key') - ReturnedValue: IInvocationExpression ( Function .get_key() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'key') + ReturnedValue: IPropertyReferenceExpression: ReadOnly Property .key As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'key') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'key') - Arguments(0) InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's1') @@ -8994,12 +8890,10 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Join s1 In ... y Equals s1') ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join s1 In ... y Equals s1') Initializers(3): - IInvocationExpression ( Function .get_key() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Join s1 In ... y Equals s1') + IPropertyReferenceExpression: ReadOnly Property .key As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'Join s1 In ... y Equals s1') Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Join s1 In ... y Equals s1') - Arguments(0) - IInvocationExpression ( Function .get_Group() As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Join s1 In ... y Equals s1') + IPropertyReferenceExpression: ReadOnly Property .Group As System.Collections.Generic.IEnumerable(Of System.Int32) (OperationKind.PropertyReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Join s1 In ... y Equals s1') Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Join s1 In ... y Equals s1') - Arguments(0) IParameterReferenceExpression: s1 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Join s1 In ... y Equals s1') InConversion: null OutConversion: null @@ -9746,9 +9640,8 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste ReturnedValue: IBinaryOperatorExpression (BinaryOperatorKind.Multiply, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '(s1 + 1) * 2') Left: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Int32) (Syntax: '(s1 + 1)') Operand: IBinaryOperatorExpression (BinaryOperatorKind.Add, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 's1 + 1') - Left: IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's3') + Left: IPropertyReferenceExpression: ReadOnly Property .s1 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's3') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's3') - Arguments(0) Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') InConversion: null @@ -9770,12 +9663,10 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Group Join ... gr2 = Group') ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group Join ... gr2 = Group') Initializers(3): - IInvocationExpression ( Function .get_s1() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Group Join ... gr2 = Group') + IPropertyReferenceExpression: ReadOnly Property .s1 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'Group Join ... gr2 = Group') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Group Join ... gr2 = Group') - Arguments(0) - IInvocationExpression ( Function .get_gr1() As System.Collections.Generic.IEnumerable(Of System.Int32)) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... gr2 = Group') + IPropertyReferenceExpression: ReadOnly Property .gr1 As System.Collections.Generic.IEnumerable(Of System.Int32) (OperationKind.PropertyReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... gr2 = Group') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Group Join ... gr2 = Group') - Arguments(0) IParameterReferenceExpression: $VB$ItAnonymous (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable(Of System.Int32)) (Syntax: 'Group Join ... gr2 = Group') InConversion: null OutConversion: null @@ -9904,9 +9795,8 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste Operand: IAnonymousFunctionExpression (Symbol: Function ($VB$It As ) As System.Int32) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: 's2') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's2') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2') - ReturnedValue: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2') + ReturnedValue: IPropertyReferenceExpression: ReadOnly Property .s2 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's2') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2') - Arguments(0) InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: innerKeySelector) (OperationKind.Argument) (Syntax: 's4') @@ -9926,12 +9816,10 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Join ... 2 Equals s4') ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Join ... 2 Equals s4') Initializers(3): - IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Join ... 2 Equals s4') + IPropertyReferenceExpression: ReadOnly Property .s2 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'Join ... 2 Equals s4') Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Join ... 2 Equals s4') - Arguments(0) - IInvocationExpression ( Function .get_s3() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Join ... 2 Equals s4') + IPropertyReferenceExpression: ReadOnly Property .s3 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'Join ... 2 Equals s4') Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Join ... 2 Equals s4') - Arguments(0) IParameterReferenceExpression: s4 (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Join ... 2 Equals s4') InConversion: null OutConversion: null @@ -9952,9 +9840,8 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste Operand: IAnonymousFunctionExpression (Symbol: Function ($VB$It As ) As System.Int32) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: 's2') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's2') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's2') - ReturnedValue: IInvocationExpression ( Function .get_s2() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 's2') + ReturnedValue: IPropertyReferenceExpression: ReadOnly Property .s2 As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 's2') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 's2') - Arguments(0) InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group Join ... s3 = Group') @@ -11185,12 +11072,10 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x > y') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x > y') ReturnedValue: IBinaryOperatorExpression (BinaryOperatorKind.GreaterThan, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'x > y') - Left: IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x > y') + Left: IPropertyReferenceExpression: ReadOnly Property .x As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x > y') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x > y') - Arguments(0) - Right: IInvocationExpression ( Function .get_y() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x > y') + Right: IPropertyReferenceExpression: ReadOnly Property .y As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x > y') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x > y') - Arguments(0) InConversion: null OutConversion: null Arguments(1): @@ -11201,12 +11086,10 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x + y') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y') ReturnedValue: IBinaryOperatorExpression (BinaryOperatorKind.Add, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') - Left: IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y') + Left: IPropertyReferenceExpression: ReadOnly Property .x As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x + y') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y') - Arguments(0) - Right: IInvocationExpression ( Function .get_y() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y') + Right: IPropertyReferenceExpression: ReadOnly Property .y As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x + y') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y') - Arguments(0) InConversion: null OutConversion: null ]]>.Value @@ -11303,12 +11186,10 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Aggregate x ... Where(True)') ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'z In New Integer() {3}') Initializers(3): - IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Aggregate x ... Where(True)') + IPropertyReferenceExpression: ReadOnly Property .x As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'Aggregate x ... Where(True)') Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Aggregate x ... Where(True)') - Arguments(0) - IInvocationExpression ( Function .get_y() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Aggregate x ... Where(True)') + IPropertyReferenceExpression: ReadOnly Property .y As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'Aggregate x ... Where(True)') Instance Receiver: IParameterReferenceExpression: $VB$It1 (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'Aggregate x ... Where(True)') - Arguments(0) IParameterReferenceExpression: z (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'Aggregate x ... Where(True)') InConversion: null OutConversion: null @@ -11485,11 +11366,9 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste Operand: IAnonymousFunctionExpression (Symbol: Function ($VB$It As , Key z As System.Int32>) As System.Int32) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: 'x') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'x') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x') - ReturnedValue: IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x') - Instance Receiver: IInvocationExpression ( Function , Key z As System.Int32>.get_$VB$It1() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 'x') + ReturnedValue: IPropertyReferenceExpression: ReadOnly Property .x As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key z As System.Int32>.$VB$It1 As (OperationKind.PropertyReferenceExpression, Type: ) (Syntax: 'x') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key z As System.Int32>) (Syntax: 'x') - Arguments(0) - Arguments(0) InConversion: null OutConversion: null Arguments(0) @@ -11532,19 +11411,14 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x') ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Select x, y, z') Initializers(3): - IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x') - Instance Receiver: IInvocationExpression ( Function , Key z As System.Int32>.get_$VB$It1() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 'x') + IPropertyReferenceExpression: ReadOnly Property .x As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key z As System.Int32>.$VB$It1 As (OperationKind.PropertyReferenceExpression, Type: ) (Syntax: 'x') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key z As System.Int32>) (Syntax: 'x') - Arguments(0) - Arguments(0) - IInvocationExpression ( Function .get_y() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x') - Instance Receiver: IInvocationExpression ( Function , Key z As System.Int32>.get_$VB$It1() As ) (OperationKind.InvocationExpression, Type: ) (Syntax: 'x') + IPropertyReferenceExpression: ReadOnly Property .y As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x') + Instance Receiver: IPropertyReferenceExpression: ReadOnly Property , Key z As System.Int32>.$VB$It1 As (OperationKind.PropertyReferenceExpression, Type: ) (Syntax: 'x') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key z As System.Int32>) (Syntax: 'x') - Arguments(0) - Arguments(0) - IInvocationExpression ( Function , Key z As System.Int32>.get_z() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x') + IPropertyReferenceExpression: ReadOnly Property , Key z As System.Int32>.z As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: , Key z As System.Int32>) (Syntax: 'x') - Arguments(0) InConversion: null OutConversion: null Arguments(1): @@ -11556,26 +11430,20 @@ ITranslatedQueryExpression (OperationKind.TranslatedQueryExpression, Type: Syste IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'x + y + z') ReturnedValue: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'w = x + y + z') Initializers(4): - IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y + z') + IPropertyReferenceExpression: ReadOnly Property .x As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x + y + z') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y + z') - Arguments(0) - IInvocationExpression ( Function .get_y() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y + z') + IPropertyReferenceExpression: ReadOnly Property .y As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x + y + z') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y + z') - Arguments(0) - IInvocationExpression ( Function .get_z() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y + z') + IPropertyReferenceExpression: ReadOnly Property .z As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x + y + z') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y + z') - Arguments(0) IBinaryOperatorExpression (BinaryOperatorKind.Add, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y + z') Left: IBinaryOperatorExpression (BinaryOperatorKind.Add, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'x + y') - Left: IInvocationExpression ( Function .get_x() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y + z') + Left: IPropertyReferenceExpression: ReadOnly Property .x As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x + y + z') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y + z') - Arguments(0) - Right: IInvocationExpression ( Function .get_y() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y + z') + Right: IPropertyReferenceExpression: ReadOnly Property .y As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x + y + z') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y + z') - Arguments(0) - Right: IInvocationExpression ( Function .get_z() As System.Int32) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'x + y + z') + Right: IPropertyReferenceExpression: ReadOnly Property .z As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: 'x + y + z') Instance Receiver: IParameterReferenceExpression: $VB$It (OperationKind.ParameterReferenceExpression, Type: ) (Syntax: 'x + y + z') - Arguments(0) InConversion: null OutConversion: null Arguments(1): @@ -14218,6 +14086,131 @@ BC30451: 'Whi' is not declared. It may be inaccessible due to its protection lev ) End Sub + + + Public Sub IOperationForQueryClause() + Dim source = 0'BIND:"Where s > 0" + + End Sub +End Module]]>.Value + + Dim expectedOperationTree = 0') + Instance Receiver: ILocalReferenceExpression: q (OperationKind.LocalReferenceExpression, Type: QueryAble) (Syntax: 'q') + Arguments(1): + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 's > 0') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32, System.Boolean)) (Syntax: 's > 0') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IAnonymousFunctionExpression (Symbol: Function (s As System.Int32) As System.Boolean) (OperationKind.AnonymousFunctionExpression, Type: null) (Syntax: 's > 0') + IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 's > 0') + IReturnStatement (OperationKind.ReturnStatement) (Syntax: 's > 0') + ReturnedValue: IBinaryOperatorExpression (BinaryOperatorKind.GreaterThan, Checked) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 's > 0') + Left: IParameterReferenceExpression: s (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 's > 0') + Right: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') + InConversion: null + OutConversion: null +]]>.Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of WhereClauseSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + + Public Sub IOperationForCollectionRangeVariable() + Dim source = 0 Where 10 > s'BIND:"s In q" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of CollectionRangeVariableSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + + Public Sub IOperationForRangeVariableReference() + Dim source = 0'BIND:"s" + End Sub +End Module]]>.Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of IdentifierNameSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub End Class End Namespace From 94b42e6b890135e17c6f33c486ee30acb133dae2 Mon Sep 17 00:00:00 2001 From: Manish Vasani Date: Tue, 19 Sep 2017 05:49:40 -0700 Subject: [PATCH 6/8] Address review feedback --- .../Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb | 4 ++-- .../VisualBasicOperationFactory_QueryLambdaRewriter.vb | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb b/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb index fc6285313fbd5..cfddaed53c962 100644 --- a/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb +++ b/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Query.vb @@ -101,8 +101,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic If isReservedName AndAlso Not String.Equals(parameterName, StringConstants.Group, StringComparison.Ordinal) Then If parameter.Type.IsErrorType() Then - ' Skip adding to the range variable map for error case. - firstUnmappedRangeVariable += 1 + ' Skip adding variables to the range variable map and bail out for error case. + Return Else ' Compound variable. ' Each range variable is an Anonymous Type property. diff --git a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb index 058edfcae0fa8..c5e2c7260a90f 100644 --- a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb +++ b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb @@ -42,8 +42,7 @@ Namespace Microsoft.CodeAnalysis.Semantics Public Overrides Function VisitRangeVariable(node As BoundRangeVariable) As BoundNode Dim expression As BoundExpression = Nothing If Not _rangeVariableMap.TryGetValue(node.RangeVariable, expression) Then - ' _rangeVariableMap should contain an entry for the range variable, except for error cases. - Debug.Assert(node.HasErrors OrElse node.RangeVariable.Type.IsErrorType()) + ' _rangeVariableMap might not contain an entry for the range variable for error cases. Return node End If From 68eb56acee65325a56825e564a44cf57be526120 Mon Sep 17 00:00:00 2001 From: Manish Vasani Date: Wed, 20 Sep 2017 10:51:49 -0700 Subject: [PATCH 7/8] Skip failing tests, re-enabling tracked by https://github.com/dotnet/roslyn/issues/22224 --- .../VisualBasic/Test/Semantic/IOperation/IOperationTests.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb index 7dc10e81213c6..0327293e76533 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb @@ -382,7 +382,7 @@ BC30581: 'AddressOf' expression cannot be converted to 'Integer' because 'Intege End Sub - + Public Sub TestClone() Dim sourceCode = TestResource.AllInOneVisualBasicCode @@ -397,7 +397,7 @@ BC30581: 'AddressOf' expression cannot be converted to 'Integer' because 'Intege End Sub - + Public Sub TestParentOperations() Dim sourceCode = TestResource.AllInOneVisualBasicCode From 2e973fdbb6365671057adbdf5c4032ffab5d2252 Mon Sep 17 00:00:00 2001 From: Manish Vasani Date: Wed, 20 Sep 2017 13:22:29 -0700 Subject: [PATCH 8/8] Address PR feedback from Chuck --- .../VisualBasicOperationFactory_QueryLambdaRewriter.vb | 2 -- .../VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb index c5e2c7260a90f..64a57c6035d86 100644 --- a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb +++ b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory_QueryLambdaRewriter.vb @@ -69,8 +69,6 @@ Namespace Microsoft.CodeAnalysis.Semantics Private ReadOnly _uniqueNodes As New HashSet(Of BoundParameter) Public Overrides Function VisitParameter(node As BoundParameter) As BoundNode - node = DirectCast(MyBase.VisitParameter(node), BoundParameter) - If node.ParameterSymbol?.ContainingSymbol.IsQueryLambdaMethod AndAlso Not _uniqueNodes.Add(node) Then node = New BoundParameter(node.Syntax, node.ParameterSymbol, node.IsLValue, node.SuppressVirtualCalls, node.Type, node.HasErrors) End If diff --git a/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb b/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb index 91cfe507fb642..c828b8865802c 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/Semantics/QueryExpressions.vb @@ -1,4 +1,4 @@ -' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.VisualBasic @@ -155,8 +155,6 @@ End Class Module Module1 Sub Main() Dim q As New QueryAble() - Dim q1 As Object = From s In q Where s > 0 - System.Console.WriteLine("-----") Dim q2 As Object = From s In q Where s > 0 Where 10 > s'BIND:"From s In q Where s > 0 Where 10 > s" End Sub End Module]]>.Value @@ -536,8 +534,6 @@ End Class Module Module1 Sub Main() - Dim q As New QueryAble2() - Dim q1 As Object = From s In q Dim y = From z In New C Select z Select z = z.ToString() Select z.ToUpper()'BIND:"From z In New C Select z Select z = z.ToString() Select z.ToUpper()" End Sub End Module]]>.Value