From 3191807e88ac330369c707e4f5b62c54b012b0e5 Mon Sep 17 00:00:00 2001 From: Costin Zaharia <56015273+costin-zaharia-sonarsource@users.noreply.github.com> Date: Fri, 9 Aug 2024 09:48:58 +0200 Subject: [PATCH] ShimLayer: Add support for OperationInterfaces (#9624) --- .../OperationLightupGenerator.cs | 20 +- .../OperationInterfaces.xml | 835 +++++++++--------- 2 files changed, 423 insertions(+), 432 deletions(-) diff --git a/analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/OperationLightupGenerator.cs b/analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/OperationLightupGenerator.cs index 72dfc8c96a2..53f20e8a143 100644 --- a/analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/OperationLightupGenerator.cs +++ b/analyzers/src/SonarAnalyzer.ShimLayer.CodeGeneration/OperationLightupGenerator.cs @@ -264,7 +264,7 @@ private void GenerateOperationInterface(in GeneratorExecutionContext context, In continue; } - var propertyType = property.NeedsWrapper ? SyntaxFactory.IdentifierName(property.Type + "Wrapper") : property.AccessorResultType; + var propertyType = property.NeedsWrapper ? SyntaxFactory.IdentifierName(property.WrappedType) : property.AccessorResultType; // Sonar // ConstructorAccessor(this.WrappedOperation) var evaluatedAccessor = SyntaxFactory.InvocationExpression( @@ -321,7 +321,7 @@ private void GenerateOperationInterface(in GeneratorExecutionContext context, In var propertyType = property.IsSkipped ? SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.ObjectKeyword)) - : property.NeedsWrapper ? SyntaxFactory.IdentifierName(property.Type + "Wrapper") : property.AccessorResultType; + : property.NeedsWrapper ? SyntaxFactory.IdentifierName(property.WrappedType) : property.AccessorResultType; // Sonar // public IOperation Instance => ((IMemberReferenceOperationWrapper)this).Instance; members = members.Add(SyntaxFactory.PropertyDeclaration( @@ -1028,12 +1028,14 @@ public PropertyData(XElement node) this.Name = node.Attribute("Name").Value; this.AccessorName = this.Name + "Accessor"; this.Type = node.Attribute("Type").Value; + this.TypeNonNullable = Type.TrimEnd('?'); // Sonar - When comparing types as strings, the nullable suffix should be ignored. + this.WrappedType = TypeNonNullable + "Wrapper"; // Sonar this.IsNew = node.Attribute("New")?.Value == "true"; this.IsPublicProperty = node.Attribute("Internal")?.Value != "true"; this.IsOverride = node.Attribute("Override")?.Value == "true"; - this.IsSkipped = this.Type switch + this.IsSkipped = this.TypeNonNullable switch // Sonar { "ArgumentKind" => true, "BranchKind" => true, @@ -1048,8 +1050,8 @@ public PropertyData(XElement node) _ => !this.IsPublicProperty || this.IsOverride, }; - this.NeedsWrapper = IsAnyOperation(this.Type) && this.Type != "IOperation"; - this.IsDerivedOperationArray = IsAnyOperationArray(this.Type) && this.Type != "ImmutableArray"; + this.NeedsWrapper = IsAnyOperation(TypeNonNullable) && TypeNonNullable != "IOperation"; // Sonar + this.IsDerivedOperationArray = IsAnyOperationArray(TypeNonNullable) && TypeNonNullable != "ImmutableArray"; // Sonar if (this.IsDerivedOperationArray) { @@ -1057,7 +1059,7 @@ public PropertyData(XElement node) identifier: SyntaxFactory.Identifier("ImmutableArray"), typeArgumentList: SyntaxFactory.TypeArgumentList(SyntaxFactory.SingletonSeparatedList(SyntaxFactory.IdentifierName("IOperation")))); } - else if (IsAnyOperation(this.Type)) + else if (IsAnyOperation(TypeNonNullable)) // Sonar { this.AccessorResultType = SyntaxFactory.IdentifierName("IOperation"); } @@ -1071,7 +1073,7 @@ public PropertyData(XElement node) public bool IsPublicProperty { get; } - public bool IsOverride{ get; } // Added by Sonar. Usages are also by Sonar. + public bool IsOverride { get; } // Added by Sonar. Usages are also by Sonar. public bool IsSkipped { get; } @@ -1081,6 +1083,10 @@ public PropertyData(XElement node) public string Type { get; } + public string TypeNonNullable { get; } // Sonar + + public string WrappedType { get; } // Sonar + public bool NeedsWrapper { get; } public bool IsDerivedOperationArray { get; } diff --git a/analyzers/src/SonarAnalyzer.ShimLayer/OperationInterfaces.xml b/analyzers/src/SonarAnalyzer.ShimLayer/OperationInterfaces.xml index bdc923501d7..585317d2675 100644 --- a/analyzers/src/SonarAnalyzer.ShimLayer/OperationInterfaces.xml +++ b/analyzers/src/SonarAnalyzer.ShimLayer/OperationInterfaces.xml @@ -30,9 +30,9 @@ Represents an invalid operation with one or more child operations. - Current usage: - (1) C# invalid expression or invalid statement. - (2) VB invalid expression or invalid statement. + Current usage: + (1) C# invalid expression or invalid statement. + (2) VB invalid expression or invalid statement. @@ -42,9 +42,9 @@ Represents a block containing a sequence of operations and local declarations. - Current usage: - (1) C# "{ ... }" block statement. - (2) VB implicit block statement for method bodies and other block scoped statements. + Current usage: + (1) C# "{ ... }" block statement. + (2) VB implicit block statement for method bodies and other block scoped statements. @@ -64,12 +64,12 @@ Represents a variable declaration statement. Current Usage: - (1) C# local declaration statement - (2) C# fixed statement - (3) C# using statement - (4) C# using declaration - (5) VB Dim statement - (6) VB Using statement + (1) C# local declaration statement + (2) C# fixed statement + (3) C# using statement + (4) C# using declaration + (5) VB Dim statement + (6) VB Using statement @@ -86,9 +86,9 @@ Represents a switch operation with a value to be switched upon and switch cases. - Current usage: - (1) C# switch statement. - (2) VB Select Case statement. + Current usage: + (1) C# switch statement. + (2) VB Select Case statement. @@ -121,7 +121,7 @@ Represents a loop operation. - Current usage: + Current usage: (1) C# 'while', 'for', 'foreach' and 'do' loop statements (2) VB 'While', 'ForTo', 'ForEach', 'Do While' and 'Do Until' loop statements @@ -159,9 +159,9 @@ Represents a for each loop. - Current usage: - (1) C# 'foreach' loop statement - (2) VB 'For Each' loop statement + Current usage: + (1) C# 'foreach' loop statement + (2) VB 'For Each' loop statement @@ -183,7 +183,7 @@ - + @@ -199,8 +199,8 @@ Represents a for loop. - Current usage: - (1) C# 'for' loop statement + Current usage: + (1) C# 'for' loop statement @@ -218,7 +218,7 @@ - + Condition of the loop. For C#, this comes from the second clause of the for statement. @@ -235,8 +235,8 @@ Represents a for to loop with loop control variable and initial, limit and step values for the control variable. - Current usage: - (1) VB 'For ... To ... Step' loop statement + Current usage: + (1) VB 'For ... To ... Step' loop statement @@ -266,8 +266,7 @@ - true if arithmetic operations behind this loop are 'checked'. - + true if arithmetic operations behind this loop are 'checked'. @@ -283,13 +282,13 @@ Represents a while or do while loop. - Current usage: - (1) C# 'while' and 'do while' loop statements. - (2) VB 'While', 'Do While' and 'Do Until' loop statements. + Current usage: + (1) C# 'while' and 'do while' loop statements. + (2) VB 'While', 'Do While' and 'Do Until' loop statements. - + Condition of the loop. This can only be null in error scenarios. @@ -304,12 +303,10 @@ - - True if the loop has 'Until' loop semantics and the loop is executed while is false. - + True if the loop has 'Until' loop semantics and the loop is executed while is false. - + Additional conditional supplied for loop in error cases, which is ignored by the compiler. @@ -325,9 +322,9 @@ Represents an operation with a label. - Current usage: - (1) C# labeled statement. - (2) VB label statement. + Current usage: + (1) C# labeled statement. + (2) VB label statement. @@ -336,7 +333,7 @@ Label that can be the target of branches. - + Operation that has been labeled. In VB, this is always null. @@ -347,9 +344,9 @@ Represents a branch operation. - Current usage: - (1) C# goto, break, or continue statement. - (2) VB GoTo, Exit ***, or Continue *** statement. + Current usage: + (1) C# goto, break, or continue statement. + (2) VB GoTo, Exit ***, or Continue *** statement. @@ -369,8 +366,8 @@ Represents an empty or no-op operation. - Current usage: - (1) C# empty statement. + Current usage: + (1) C# empty statement. @@ -385,13 +382,13 @@ Represents a return from the method with an optional return value. - Current usage: - (1) C# return statement and yield statement. - (2) VB Return statement. + Current usage: + (1) C# return statement and yield statement. + (2) VB Return statement. - + Value to be returned. @@ -402,9 +399,9 @@ Represents a of operations that are executed while holding a lock onto the . - Current usage: - (1) C# lock statement. - (2) VB SyncLock statement. + Current usage: + (1) C# lock statement. + (2) VB SyncLock statement. @@ -418,16 +415,16 @@ Body of the lock, to be executed while holding the lock. - + Represents a try operation for exception handling code with a body, catch clauses and a finally handler. - Current usage: - (1) C# try statement. - (2) VB Try statement. + Current usage: + (1) C# try statement. + (2) VB Try statement. @@ -441,12 +438,12 @@ Catch clauses of the try. - + Finally handler of the try. - + Exit label for the try. This will always be null for C#. @@ -457,9 +454,9 @@ Represents a of operations that are executed while using disposable . - Current usage: - (1) C# using statement. - (2) VB Using statement. + Current usage: + (1) C# using statement. + (2) VB Using statement. @@ -490,9 +487,7 @@ - - Information about the method that will be invoked to dispose the when pattern based disposal is used. - + Information about the method that will be invoked to dispose the when pattern based disposal is used. @@ -501,9 +496,9 @@ Represents an operation that drops the resulting value and the type of the underlying wrapped . - Current usage: - (1) C# expression statement. - (2) VB expression statement. + Current usage: + (1) C# expression statement. + (2) VB expression statement. @@ -518,8 +513,8 @@ Represents a local function defined within a method. - Current usage: - (1) C# local function statement. + Current usage: + (1) C# local function statement. @@ -528,13 +523,13 @@ Local function symbol. - + Body of the local function. This can be null in error scenarios, or when the method is an extern method. - + An extra body for the local function, if both a block body and expression body are specified in source. This is only ever non-null in error situations. @@ -546,8 +541,8 @@ Represents an operation to stop or suspend execution of code. - Current usage: - (1) VB Stop statement. + Current usage: + (1) VB Stop statement. @@ -557,8 +552,8 @@ Represents an operation that stops the execution of code abruptly. - Current usage: - (1) VB End Statement. + Current usage: + (1) VB End Statement. @@ -568,8 +563,8 @@ Represents an operation for raising an event. - Current usage: - (1) VB raise event statement. + Current usage: + (1) VB raise event statement. @@ -593,9 +588,9 @@ Represents a textual literal numeric, string, etc. - Current usage: - (1) C# literal expression. - (2) VB literal expression. + Current usage: + (1) C# literal expression. + (2) VB literal expression. @@ -605,9 +600,9 @@ Represents a type conversion. - Current usage: - (1) C# conversion expression. - (2) VB conversion expression. + Current usage: + (1) C# conversion expression. + (2) VB conversion expression. @@ -616,12 +611,12 @@ Value to be converted. - + Operator method used by the operation, null if the operation does not use an operator method. - + Type parameter which runtime type will be used to resolve virtual invocation of the , if any. @@ -658,16 +653,16 @@ Represents an invocation of a method. - Current usage: - (1) C# method invocation expression. - (2) C# collection element initializer. - For example, in the following collection initializer: new C() { 1, 2, 3 }, we will have - 3 nodes, each of which will be a call to the corresponding Add method - with either 1, 2, 3 as the argument. - (3) VB method invocation expression. - (4) VB collection element initializer. - Similar to the C# example, New C() From {1, 2, 3} will have 3 - nodes with 1, 2, and 3 as their arguments, respectively. + Current usage: + (1) C# method invocation expression. + (2) C# collection element initializer. + For example, in the following collection initializer: new C() { 1, 2, 3 }, we will have + 3 nodes, each of which will be a call to the corresponding Add method + with either 1, 2, 3 as the argument. + (3) VB method invocation expression. + (4) VB collection element initializer. + Similar to the C# example, New C() From {1, 2, 3} will have 3 + nodes with 1, 2, and 3 as their arguments, respectively. @@ -676,7 +671,7 @@ Method to be invoked. - + Type parameter which runtime type will be used to resolve virtual invocation of the . @@ -684,7 +679,7 @@ - + 'This' or 'Me' instance to be supplied to the method, or null if the method is static. @@ -709,9 +704,9 @@ Represents a reference to an array element. - Current usage: - (1) C# array element reference expression. - (2) VB array element reference expression. + Current usage: + (1) C# array element reference expression. + (2) VB array element reference expression. @@ -731,9 +726,9 @@ Represents a reference to a declared local variable. - Current usage: - (1) C# local reference expression. - (2) VB local reference expression. + Current usage: + (1) C# local reference expression. + (2) VB local reference expression. @@ -756,9 +751,9 @@ Represents a reference to a parameter. - Current usage: - (1) C# parameter reference expression. - (2) VB parameter reference expression. + Current usage: + (1) C# parameter reference expression. + (2) VB parameter reference expression. @@ -768,18 +763,18 @@ - + Represents a reference to a member of a class, struct, or interface. - Current usage: - (1) C# member reference expression. - (2) VB member reference expression. + Current usage: + (1) C# member reference expression. + (2) VB member reference expression. - + Instance of the type. Null if the reference is to a static/shared member. @@ -789,7 +784,7 @@ Referenced member. - + Type parameter which runtime type will be used to resolve virtual invocation of the . @@ -803,9 +798,9 @@ Represents a reference to a field. - Current usage: - (1) C# field reference expression. - (2) VB field reference expression. + Current usage: + (1) C# field reference expression. + (2) VB field reference expression. @@ -829,9 +824,9 @@ Represents a reference to a method other than as the target of an invocation. - Current usage: - (1) C# method reference expression. - (2) VB method reference expression. + Current usage: + (1) C# method reference expression. + (2) VB method reference expression. @@ -840,7 +835,7 @@ Referenced method. - + Indicates whether the reference uses virtual semantics. @@ -852,9 +847,9 @@ Represents a reference to a property. - Current usage: - (1) C# property reference expression. - (2) VB property reference expression. + Current usage: + (1) C# property reference expression. + (2) VB property reference expression. @@ -863,7 +858,7 @@ Referenced property. - + Arguments of the indexer property reference, excluding the instance argument. Arguments are in evaluation order. @@ -879,9 +874,9 @@ Represents a reference to an event. - Current usage: - (1) C# event reference expression. - (2) VB event reference expression. + Current usage: + (1) C# event reference expression. + (2) VB event reference expression. @@ -890,7 +885,7 @@ Referenced event. - + @@ -901,9 +896,9 @@ Represents an operation with one operand and a unary operator. - Current usage: - (1) C# unary operation expression. - (2) VB unary operation expression. + Current usage: + (1) C# unary operation expression. + (2) VB unary operation expression. @@ -934,12 +929,12 @@ - + Operator method used by the operation, null if the operation does not use an operator method. - + Type parameter which runtime type will be used to resolve virtual invocation of the , if any. @@ -957,9 +952,9 @@ Represents an operation with two operands and a binary operator that produces a result with a non-null type. - Current usage: - (1) C# binary operator expression. - (2) VB binary operator expression. + Current usage: + (1) C# binary operator expression. + (2) VB binary operator expression. @@ -1002,12 +997,12 @@ - + Operator method used by the operation, null if the operation does not use an operator method. - + Type parameter which runtime type will be used to resolve virtual invocation of the @@ -1016,7 +1011,7 @@ - + True/False operator method used for short circuiting. @@ -1033,9 +1028,9 @@ (2) operation to be executed when is true and (3) operation to be executed when the is false. - Current usage: - (1) C# ternary expression "a ? b : c" and if statement. - (2) VB ternary expression "If(a, b, c)" and If Else statement. + Current usage: + (1) C# ternary expression "a ? b : c" and if statement. + (2) VB ternary expression "If(a, b, c)" and If Else statement. @@ -1051,7 +1046,7 @@ - + Operation to be executed if the is false. @@ -1071,9 +1066,9 @@ (1) , which is the first operand that is unconditionally evaluated and is the result of the operation if non null. (2) , which is the second operand that is conditionally evaluated and is the result of the operation if is null. - Current usage: - (1) C# null-coalescing expression "Value ?? WhenNull". - (2) VB binary conditional expression "If(Value, WhenNull)". + Current usage: + (1) C# null-coalescing expression "Value ?? WhenNull". + (2) VB binary conditional expression "If(Value, WhenNull)". @@ -1110,9 +1105,9 @@ Represents an anonymous function operation. - Current usage: - (1) C# lambda expression. - (2) VB anonymous delegate expression. + Current usage: + (1) C# lambda expression. + (2) VB anonymous delegate expression. @@ -1132,18 +1127,18 @@ Represents creation of an object instance. - Current usage: - (1) C# new expression. - (2) VB New expression. + Current usage: + (1) C# new expression. + (2) VB New expression. - + Constructor to be invoked on the created instance. - + Object or collection initializer, if any. @@ -1163,13 +1158,13 @@ Represents a creation of a type parameter object, i.e. new T(), where T is a type parameter with new constraint. - Current usage: - (1) C# type parameter object creation expression. - (2) VB type parameter object creation expression. + Current usage: + (1) C# type parameter object creation expression. + (2) VB type parameter object creation expression. - + Object or collection initializer, if any. @@ -1180,9 +1175,9 @@ Represents the creation of an array instance. - Current usage: - (1) C# array creation expression. - (2) VB array creation expression. + Current usage: + (1) C# array creation expression. + (2) VB array creation expression. @@ -1191,7 +1186,7 @@ Sizes of the dimensions of the created array instance. - + Values of elements of the created array instance. @@ -1202,11 +1197,11 @@ Represents an implicit/explicit reference to an instance. - Current usage: - (1) C# this or base expression. - (2) VB Me, MyClass, or MyBase expression. - (3) C# object or collection or 'with' expression initializers. - (4) VB With statements, object or collection initializers. + Current usage: + (1) C# this or base expression. + (2) VB Me, MyClass, or MyBase expression. + (3) C# object or collection or 'with' expression initializers. + (4) VB With statements, object or collection initializers. @@ -1221,9 +1216,9 @@ Represents an operation that tests if a value is of a specific type. - Current usage: - (1) C# "is" operator expression. - (2) VB "TypeOf" and "TypeOf IsNot" expression. + Current usage: + (1) C# "is" operator expression. + (2) VB "TypeOf" and "TypeOf IsNot" expression. @@ -1252,9 +1247,9 @@ Represents an await operation. - Current usage: - (1) C# await expression. - (2) VB await expression. + Current usage: + (1) C# await expression. + (2) VB await expression. @@ -1269,9 +1264,9 @@ Represents a base interface for assignments. - Current usage: - (1) C# simple, compound and deconstruction assignment expressions. - (2) VB simple and compound assignment expressions. + Current usage: + (1) C# simple, compound and deconstruction assignment expressions. + (2) VB simple and compound assignment expressions. @@ -1291,9 +1286,9 @@ Represents a simple assignment operation. - Current usage: - (1) C# simple assignment expression. - (2) VB simple assignment expression. + Current usage: + (1) C# simple assignment expression. + (2) VB simple assignment expression. @@ -1308,9 +1303,9 @@ Represents a compound assignment that mutates the target with the result of a binary operation. - Current usage: - (1) C# compound assignment expression. - (2) VB compound assignment expression. + Current usage: + (1) C# compound assignment expression. + (2) VB compound assignment expression. @@ -1348,12 +1343,12 @@ - + Operator method used by the operation, null if the operation does not use an operator method. - + Type parameter which runtime type will be used to resolve virtual invocation of the , if any. @@ -1367,8 +1362,8 @@ Represents a parenthesized operation. - Current usage: - (1) VB parenthesized expression. + Current usage: + (1) VB parenthesized expression. @@ -1383,9 +1378,9 @@ Represents a binding of an event. - Current usage: - (1) C# event assignment expression. - (2) VB Add/Remove handler statement. + Current usage: + (1) C# event assignment expression. + (2) VB Add/Remove handler statement. @@ -1411,9 +1406,9 @@ Represents a conditionally accessed operation. Note that is used to refer to the value of within . - Current usage: - (1) C# conditional access expression (? or ?. operator). - (2) VB conditional access expression (? or ?. operator). + Current usage: + (1) C# conditional access expression (? or ?. operator). + (2) VB conditional access expression (? or ?. operator). @@ -1437,9 +1432,9 @@ For a conditional access operation of the form someExpr?.Member, this operation is used as the InstanceReceiver for the right operation Member. See https://github.com/dotnet/roslyn/issues/21279#issuecomment-323153041 for more details. - Current usage: - (1) C# conditional access instance expression. - (2) VB conditional access instance expression. + Current usage: + (1) C# conditional access instance expression. + (2) VB conditional access instance expression. @@ -1449,9 +1444,9 @@ Represents an interpolated string. - Current usage: - (1) C# interpolated string expression. - (2) VB interpolated string expression. + Current usage: + (1) C# interpolated string expression. + (2) VB interpolated string expression. @@ -1468,9 +1463,9 @@ Represents a creation of anonymous object. - Current usage: - (1) C# "new { ... }" expression - (2) VB "New With { ... }" expression + Current usage: + (1) C# "new { ... }" expression + (2) VB "New With { ... }" expression @@ -1489,11 +1484,11 @@ Represents an initialization for an object or collection creation. - Current usage: - (1) C# object or collection initializer expression. - (2) VB object or collection initializer expression. - For example, object initializer "{ X = x }" within object creation "new Class() { X = x }" and - collection initializer "{ x, y, 3 }" within collection creation "new MyList() { x, y, 3 }". + Current usage: + (1) C# object or collection initializer expression. + (2) VB object or collection initializer expression. + For example, object initializer "{ X = x }" within object creation "new Class() { X = x }" and + collection initializer "{ x, y, 3 }" within collection creation "new MyList() { x, y, 3 }". @@ -1508,8 +1503,8 @@ Represents an initialization of member within an object initializer with a nested object or collection initializer. - Current usage: - (1) C# nested member initializer expression. + Current usage: + (1) C# nested member initializer expression. For example, given an object creation with initializer "new Class() { X = x, Y = { x, y, 3 }, Z = { X = z } }", member initializers for Y and Z, i.e. "Y = { x, y, 3 }", and "Z = { X = z }" are nested member initializers represented by this operation. @@ -1535,7 +1530,7 @@ Obsolete interface that used to represent a collection element initializer. It has been replaced by and , as appropriate. - Current usage: + Current usage: None. This API has been obsoleted in favor of and . @@ -1549,9 +1544,9 @@ Represents an operation that gets a string value for the name. - Current usage: - (1) C# nameof expression. - (2) VB NameOf expression. + Current usage: + (1) C# nameof expression. + (2) VB NameOf expression. @@ -1566,9 +1561,9 @@ Represents a tuple with one or more elements. - Current usage: - (1) C# tuple expression. - (2) VB tuple expression. + Current usage: + (1) C# tuple expression. + (2) VB tuple expression. @@ -1577,7 +1572,7 @@ Tuple elements. - + Natural type of the tuple, or null if tuple doesn't have a natural type. @@ -1592,13 +1587,13 @@ Represents an object creation with a dynamically bound constructor. - Current usage: - (1) C# "new" expression with dynamic argument(s). - (2) VB late bound "New" expression. + Current usage: + (1) C# "new" expression with dynamic argument(s). + (2) VB late bound "New" expression. - + Object or collection initializer, if any. @@ -1614,13 +1609,13 @@ Represents a reference to a member of a class, struct, or module that is dynamically bound. - Current usage: - (1) C# dynamic member reference expression. - (2) VB late bound member reference expression. + Current usage: + (1) C# dynamic member reference expression. + (2) VB late bound member reference expression. - + Instance receiver, if it exists. @@ -1635,7 +1630,7 @@ Type arguments. - + The containing type of the referenced member, if different from type of the . @@ -1648,16 +1643,16 @@ Represents a invocation that is dynamically bound. - Current usage: - (1) C# dynamic invocation expression. - (2) C# dynamic collection element initializer. - For example, in the following collection initializer: new C() { do1, do2, do3 } where - the doX objects are of type dynamic, we'll have 3 with do1, do2, and - do3 as their arguments. - (3) VB late bound invocation expression. - (4) VB dynamic collection element initializer. - Similar to the C# example, New C() From {do1, do2, do3} will generate 3 - nodes with do1, do2, and do3 as their arguments, respectively. + Current usage: + (1) C# dynamic invocation expression. + (2) C# dynamic collection element initializer. + For example, in the following collection initializer: new C() { do1, do2, do3 } where + the doX objects are of type dynamic, we'll have 3 with do1, do2, and + do3 as their arguments. + (3) VB late bound invocation expression. + (4) VB dynamic collection element initializer. + Similar to the C# example, New C() From {do1, do2, do3} will generate 3 + nodes with do1, do2, and do3 as their arguments, respectively. @@ -1677,8 +1672,8 @@ Represents an indexer access that is dynamically bound. - Current usage: - (1) C# dynamic indexer access expression. + Current usage: + (1) C# dynamic indexer access expression. @@ -1698,14 +1693,14 @@ Represents an unrolled/lowered query operation. For example, for a C# 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") + ITranslatedQueryExpression + IInvocationExpression ('Select' invocation for "select x.Name") + IInvocationExpression ('Where' invocation for "where x.Name != null") + IInvocationExpression ('From' invocation for "from x in set") - Current usage: - (1) C# query expression. - (2) VB query expression. + Current usage: + (1) C# query expression. + (2) VB query expression. @@ -1720,9 +1715,9 @@ Represents a delegate creation. This is created whenever a new delegate is created. - Current usage: - (1) C# delegate creation expression. - (2) VB delegate creation expression. + Current usage: + (1) C# delegate creation expression. + (2) VB delegate creation expression. @@ -1737,8 +1732,8 @@ Represents a default value operation. - Current usage: - (1) C# default value expression. + Current usage: + (1) C# default value expression. @@ -1748,9 +1743,9 @@ Represents an operation that gets for the given . - Current usage: - (1) C# typeof expression. - (2) VB GetType expression. + Current usage: + (1) C# typeof expression. + (2) VB GetType expression. @@ -1765,8 +1760,8 @@ Represents an operation to compute the size of a given type. - Current usage: - (1) C# sizeof expression. + Current usage: + (1) C# sizeof expression. @@ -1781,8 +1776,8 @@ Represents an operation that creates a pointer value by taking the address of a reference. - Current usage: - (1) C# address of expression + Current usage: + (1) C# address of expression @@ -1797,8 +1792,8 @@ Represents an operation that tests if a value matches a specific pattern. - Current usage: - (1) C# is pattern expression. For example, "x is int i". + Current usage: + (1) C# is pattern expression. For example, "x is int i". @@ -1824,8 +1819,8 @@ Note that this operation is different from an as it mutates the , while unary operator expression does not mutate it's operand. - Current usage: - (1) C# increment expression or decrement expression. + Current usage: + (1) C# increment expression or decrement expression. @@ -1858,12 +1853,12 @@ Target of the assignment. - + Operator method used by the operation, null if the operation does not use an operator method. - + Type parameter which runtime type will be used to resolve virtual invocation of the , if any. @@ -1877,14 +1872,14 @@ Represents an operation to throw an exception. - Current usage: - (1) C# throw expression. - (2) C# throw statement. - (2) VB Throw statement. + Current usage: + (1) C# throw expression. + (2) C# throw statement. + (2) VB Throw statement. - + Instance of an exception being thrown. @@ -1895,8 +1890,8 @@ Represents a assignment with a deconstruction. - Current usage: - (1) C# deconstruction assignment expression. + Current usage: + (1) C# deconstruction assignment expression. @@ -1906,11 +1901,11 @@ Represents a declaration expression operation. Unlike a regular variable declaration and , this operation represents an "expression" declaring a variable. - Current usage: - (1) C# declaration expression. For example, - (a) "var (x, y)" is a deconstruction declaration expression with variables x and y. - (b) "(var x, var y)" is a tuple expression with two declaration expressions. - (c) "M(out var x);" is an invocation expression with an out "var x" declaration expression. + Current usage: + (1) C# declaration expression. For example, + (a) "var (x, y)" is a deconstruction declaration expression with variables x and y. + (b) "(var x, var y)" is a tuple expression with two declaration expressions. + (c) "M(out var x);" is an invocation expression with an out "var x" declaration expression. @@ -1925,8 +1920,8 @@ Represents an argument value that has been omitted in an invocation. - Current usage: - (1) VB omitted argument in an invocation expression. + Current usage: + (1) VB omitted argument in an invocation expression. @@ -1936,9 +1931,9 @@ Represents an initializer for a field, property, parameter or a local variable declaration. - Current usage: - (1) C# field, property, parameter or local variable initializer. - (2) VB field(s), property, parameter or local variable initializer. + Current usage: + (1) C# field, property, parameter or local variable initializer. + (2) VB field(s), property, parameter or local variable initializer. @@ -1960,9 +1955,9 @@ Represents an initialization of a field. - Current usage: - (1) C# field initializer with equals value clause. - (2) VB field(s) initializer with equals value clause or AsNew clause. Multiple fields can be initialized with AsNew clause in VB. + Current usage: + (1) C# field initializer with equals value clause. + (2) VB field(s) initializer with equals value clause or AsNew clause. Multiple fields can be initialized with AsNew clause in VB. @@ -1977,9 +1972,9 @@ Represents an initialization of a local variable. - Current usage: - (1) C# local variable initializer with equals value clause. - (2) VB local variable initializer with equals value clause or AsNew clause. + Current usage: + (1) C# local variable initializer with equals value clause. + (2) VB local variable initializer with equals value clause or AsNew clause. @@ -1989,9 +1984,9 @@ Represents an initialization of a property. - Current usage: - (1) C# property initializer with equals value clause. - (2) VB property initializer with equals value clause or AsNew clause. Multiple properties can be initialized with 'WithEvents' declaration with AsNew clause in VB. + Current usage: + (1) C# property initializer with equals value clause. + (2) VB property initializer with equals value clause or AsNew clause. Multiple properties can be initialized with 'WithEvents' declaration with AsNew clause in VB. @@ -2006,9 +2001,9 @@ Represents an initialization of a parameter at the point of declaration. - Current usage: - (1) C# parameter initializer with equals value clause. - (2) VB parameter initializer with equals value clause. + Current usage: + (1) C# parameter initializer with equals value clause. + (2) VB parameter initializer with equals value clause. @@ -2023,9 +2018,9 @@ Represents the initialization of an array instance. - Current usage: - (1) C# array initializer. - (2) VB array initializer. + Current usage: + (1) C# array initializer. + (2) VB array initializer. @@ -2040,10 +2035,10 @@ Represents a single variable declarator and initializer. Current Usage: - (1) C# variable declarator - (2) C# catch variable declaration - (3) VB single variable declaration - (4) VB catch variable declaration + (1) C# variable declarator + (2) C# catch variable declaration + (3) VB single variable declaration + (4) VB catch variable declaration In VB, the initializer for this node is only ever used for explicit array bounds initializers. This node corresponds to @@ -2055,7 +2050,7 @@ Symbol declared by this variable declaration - + Optional initializer of the variable. @@ -2079,10 +2074,10 @@ Represents a declarator that declares multiple individual variables. Current Usage: - (1) C# VariableDeclaration - (2) C# fixed declarations - (3) VB Dim statement declaration groups - (4) VB Using statement variable declarations + (1) C# VariableDeclaration + (2) C# fixed declarations + (3) VB Dim statement declaration groups + (4) VB Using statement variable declarations The initializer of this node is applied to all individual declarations in . There cannot @@ -2100,7 +2095,7 @@ - + Optional initializer of the variable. In C#, this will always be null. @@ -2120,9 +2115,9 @@ Represents an argument to a method invocation. - Current usage: - (1) C# argument to an invocation expression, object creation expression, etc. - (2) VB argument to an invocation expression, object creation expression, etc. + Current usage: + (1) C# argument to an invocation expression, object creation expression, etc. + (2) VB argument to an invocation expression, object creation expression, etc. @@ -2131,7 +2126,7 @@ Kind of argument. - + Parameter the argument matches. This can be null for __arglist parameters. @@ -2157,13 +2152,13 @@ Represents a catch clause. - Current usage: - (1) C# catch clause. - (2) VB Catch clause. + Current usage: + (1) C# catch clause. + (2) VB Catch clause. - + Optional source for exception. This could be any of the following operation: @@ -2186,7 +2181,7 @@ - + Filter operation to be executed to determine whether to handle the exception. @@ -2202,9 +2197,9 @@ Represents a switch case section with one or more case clauses to match and one or more operations to execute within the section. - Current usage: - (1) C# switch section for one or more case clause and set of statements to execute. - (2) VB case block with a case statement for one or more case clause and set of statements to execute. + Current usage: + (1) C# switch section for one or more case clause and set of statements to execute. + (2) VB case block with a case statement for one or more case clause and set of statements to execute. @@ -2223,7 +2218,7 @@ Locals declared within the switch case section scoped to the section. - + Optional combined logical condition that accounts for all . @@ -2243,9 +2238,9 @@ Represents a case clause. - Current usage: - (1) C# case clause. - (2) VB Case clause. + Current usage: + (1) C# case clause. + (2) VB Case clause. @@ -2254,7 +2249,7 @@ Kind of the clause. - + Label associated with the case clause, if any. @@ -2266,9 +2261,9 @@ Represents a default case clause. - Current usage: - (1) C# default clause. - (2) VB Case Else clause. + Current usage: + (1) C# default clause. + (2) VB Case Else clause. @@ -2279,8 +2274,8 @@ Represents a case clause with a pattern and an optional guard operation. - Current usage: - (1) C# pattern case clause. + Current usage: + (1) C# pattern case clause. @@ -2297,7 +2292,7 @@ Pattern associated with case clause. - + Guard associated with the pattern case clause. @@ -2309,8 +2304,8 @@ Represents a case clause with range of values for comparison. - Current usage: - (1) VB range case clause of the form "Case x To y". + Current usage: + (1) VB range case clause of the form "Case x To y". @@ -2331,8 +2326,8 @@ Represents a case clause with custom relational operator for comparison. - Current usage: - (1) VB relational case clause of the form "Case Is op x". + Current usage: + (1) VB relational case clause of the form "Case Is op x". @@ -2353,9 +2348,9 @@ Represents a case clause with a single value for comparison. - Current usage: - (1) C# case clause of the form "case x" - (2) VB case clause of the form "Case x". + Current usage: + (1) C# case clause of the form "case x" + (2) VB case clause of the form "Case x". @@ -2370,9 +2365,9 @@ Represents a constituent part of an interpolated string. - Current usage: - (1) C# interpolated string content. - (2) VB interpolated string content. + Current usage: + (1) C# interpolated string content. + (2) VB interpolated string content. @@ -2382,9 +2377,9 @@ Represents a constituent string literal part of an interpolated string operation. - Current usage: - (1) C# interpolated string text. - (2) VB interpolated string text. + Current usage: + (1) C# interpolated string text. + (2) VB interpolated string text. @@ -2399,9 +2394,9 @@ Represents a constituent interpolation part of an interpolated string operation. - Current usage: - (1) C# interpolation part. - (2) VB interpolation part. + Current usage: + (1) C# interpolation part. + (2) VB interpolation part. @@ -2410,12 +2405,12 @@ Expression of the interpolation. - + Optional alignment of the interpolation. - + Optional format string of the interpolation. @@ -2426,8 +2421,8 @@ Represents a pattern matching operation. - Current usage: - (1) C# pattern. + Current usage: + (1) C# pattern. @@ -2447,8 +2442,8 @@ Represents a pattern with a constant value. - Current usage: - (1) C# constant pattern. + Current usage: + (1) C# constant pattern. @@ -2463,12 +2458,12 @@ Represents a pattern that declares a symbol. - Current usage: - (1) C# declaration pattern. + Current usage: + (1) C# declaration pattern. - + The type explicitly specified, or null if it was inferred (e.g. using var in C#). @@ -2484,7 +2479,7 @@ - + Symbol declared by the pattern, if any. @@ -2499,8 +2494,8 @@ Represents a comparison of two operands that returns a bool type. - Current usage: - (1) C# tuple binary operator expression. + Current usage: + (1) C# tuple binary operator expression. @@ -2525,17 +2520,17 @@ Represents a method body operation. - Current usage: - (1) C# method body + Current usage: + (1) C# method body - + Method body corresponding to BaseMethodDeclarationSyntax.Body or AccessorDeclarationSyntax.Body - + Method body corresponding to BaseMethodDeclarationSyntax.ExpressionBody or AccessorDeclarationSyntax.ExpressionBody @@ -2550,8 +2545,8 @@ Represents a method body operation. - Current usage: - (1) C# method body for non-constructor + Current usage: + (1) C# method body for non-constructor @@ -2565,19 +2560,17 @@ Represents a constructor method body operation. - Current usage: - (1) C# method body for constructor declaration + Current usage: + (1) C# method body for constructor declaration - - Local declarations contained within the . - + Local declarations contained within the . - + Constructor initializer, if any. @@ -2588,7 +2581,7 @@ Represents a discard operation. - Current usage: C# discard expressions + Current usage: C# discard expressions @@ -2631,9 +2624,7 @@ - - True if this reference to the capture initializes the capture. Used when the capture is being initialized by being passed as an out parameter. - + True if this reference to the capture initializes the capture. Used when the capture is being initialized by being passed as an out parameter. @@ -2681,9 +2672,9 @@ Represents an anonymous function operation in context of a . - Current usage: - (1) C# lambda expression. - (2) VB anonymous delegate expression. + Current usage: + (1) C# lambda expression. + (2) VB anonymous delegate expression. A for the body of the anonymous function is available from the enclosing . @@ -2703,8 +2694,8 @@ (2) is conditionally evaluated if is null, and the result is assigned into . The result of the entire expression is, which is only evaluated once. - Current usage: - (1) C# null-coalescing assignment operation Target ??= Value. + Current usage: + (1) C# null-coalescing assignment operation Target ??= Value. @@ -2714,17 +2705,17 @@ Represents a range operation. - Current usage: - (1) C# range expressions + Current usage: + (1) C# range expressions - + Left operand. - + Right operand. @@ -2739,7 +2730,7 @@ - + Factory method used to create this Range value. Can be null if appropriate @@ -2753,8 +2744,8 @@ Represents the ReDim operation to re-allocate storage space for array variables. - Current usage: - (1) VB ReDim statement. + Current usage: + (1) VB ReDim statement. @@ -2774,8 +2765,8 @@ Represents an individual clause of an to re-allocate storage space for a single array variable. - Current usage: - (1) VB ReDim clause. + Current usage: + (1) VB ReDim clause. @@ -2799,7 +2790,7 @@ The type accepted for the recursive pattern. - + The symbol, if any, used for the fetching values for subpatterns. This is either a Deconstruct @@ -2818,7 +2809,7 @@ This contains the (symbol, property) pairs within a property subpattern. - + Symbol declared by the pattern. @@ -2829,7 +2820,7 @@ Represents a discard pattern. - Current usage: C# discard pattern + Current usage: C# discard pattern @@ -2839,8 +2830,8 @@ Represents a switch expression. - Current usage: - (1) C# switch expression. + Current usage: + (1) C# switch expression. @@ -2855,9 +2846,9 @@ - - True if the switch expressions arms cover every possible input value. - + + True if the switch expressions arms cover every possible input value. + @@ -2869,7 +2860,7 @@ The pattern to match. - + Guard (when clause expression) associated with the switch arm, if any. @@ -2939,13 +2930,13 @@ Represents a creation of an instance of a NoPia interface, i.e. new I(), where I is an embedded NoPia interface. - Current usage: - (1) C# NoPia interface instance creation expression. - (2) VB NoPia interface instance creation expression. + Current usage: + (1) C# NoPia interface instance creation expression. + (2) VB NoPia interface instance creation expression. - + Object or collection initializer, if any. @@ -2965,8 +2956,8 @@ Represents a reference through a pointer. - Current usage: - (1) C# pointer indirection reference expression. + Current usage: + (1) C# pointer indirection reference expression. @@ -2981,8 +2972,8 @@ Represents a of operations that are executed with implicit reference to the for member references. - Current usage: - (1) VB With statement. + Current usage: + (1) VB With statement. @@ -3002,9 +2993,9 @@ Represents using variable declaration, with scope spanning across the parent . - Current Usage: - (1) C# using declaration - (1) C# asynchronous using declaration + Current Usage: + (1) C# using declaration + (1) C# asynchronous using declaration @@ -3052,9 +3043,7 @@ - - Kind of binary pattern; either or . - + Kind of binary pattern; either or . @@ -3091,8 +3080,8 @@ Represents a pattern comparing the input with a constant value using a relational operator. - Current usage: - (1) C# relational pattern. + Current usage: + (1) C# relational pattern. @@ -3122,7 +3111,7 @@ Operand to be cloned. - + Clone method to be invoked on the value. This can be null in error scenarios. @@ -3220,9 +3209,7 @@ - - Represents an argument from the method call, indexer access, or constructor invocation that is creating the containing - + Represents an argument from the method call, indexer access, or constructor invocation that is creating the containing @@ -3246,7 +3233,7 @@ Represents an invocation of a function pointer. - + Invoked pointer. @@ -3261,7 +3248,7 @@ Represents a C# list pattern. - + The Length or Count property that is used to fetch the length value. @@ -3269,7 +3256,7 @@ - + The indexer that is used to fetch elements. @@ -3284,7 +3271,7 @@ - + Symbol declared by the pattern, if any. @@ -3296,14 +3283,14 @@ Represents a C# slice pattern. - + The range indexer or the Slice method used to fetch the slice value. - + The pattern that the slice value is matched with, if any. @@ -3375,9 +3362,7 @@ - - The operation representing the attribute. This can be a in non-error cases, or an in error cases. - + The operation representing the attribute. This can be a in non-error cases, or an in error cases. @@ -3412,7 +3397,7 @@ - + Method used to construct the collection. @@ -3438,7 +3423,7 @@ - + Represents a collection expression spread element. @@ -3452,7 +3437,7 @@ Collection being spread. - + Type of the elements in the collection. @@ -3468,4 +3453,4 @@ - \ No newline at end of file +