// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespaceMicrosoft.CodeAnalysis.Semantics
{
/// <summary>
/// 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 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")
/// </summary>
/// <remarks>
/// This interface is reserved for implementation by its associated APIs. We reserve the right to
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
' _rangeVariableMap might not contain an entry for the range variable for error cases.
Returnnode
EndIf
#If DEBUG Then
' 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.
SelectCaseexpression.Kind
CaseBoundKind.Parameter
CaseBoundKind.PropertyAccess
ExitSelect
CaseElse
Debug.Fail($"Unexpected bound kind '{expression.Kind}' generated for range variable rewrite by method '{NameOf(LocalRewriter.PopulateRangeVariableMapForQueryLambdaRewrite)}'")