diff --git a/src/Compilers/VisualBasic/Portable/BoundTree/Statement.vb b/src/Compilers/VisualBasic/Portable/BoundTree/Statement.vb index 92bd7f4bc8cc28d014e1a7127da436480295e580..a4984a268dce767ad006cafb2c5c9f413b5545cb 100644 --- a/src/Compilers/VisualBasic/Portable/BoundTree/Statement.vb +++ b/src/Compilers/VisualBasic/Portable/BoundTree/Statement.vb @@ -29,6 +29,26 @@ Namespace Microsoft.CodeAnalysis.VisualBasic End Property End Class + Partial Friend Class BoundAddressOfOperator + Protected Overrides ReadOnly Property Children As ImmutableArray(Of BoundNode) + Get + Return ImmutableArray.Create(Of BoundNode)(Me.MethodGroup) + End Get + End Property + End Class + + Partial Friend Class BoundMethodGroup + Protected Overrides ReadOnly Property Children As ImmutableArray(Of BoundNode) + Get + If Me.TypeArgumentsOpt IsNot Nothing Then + Return ImmutableArray.Create(Of BoundNode)(Me.TypeArgumentsOpt) + Else + Return ImmutableArray(Of BoundNode).Empty + End If + End Get + End Property + End Class + Partial Friend Class BoundCaseBlock Protected Overrides ReadOnly Property Children As ImmutableArray(Of BoundNode) Get diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IConversionExpression.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IConversionExpression.vb index 839a58989a551f5cc0b16fec70af62732735660d..e6440b612497d3768d7344d6129db441abb2ff3c 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IConversionExpression.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IConversionExpression.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.VisualBasic.Syntax @@ -1030,6 +1030,8 @@ IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclaratio Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: 'AddressOf M2') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'AddressOf M2') + Children(1): + IOperation: (OperationKind.None, IsInvalid) (Syntax: 'M2') ]]>.Value Dim expectedDiagnostics = .Value Dim expectedDiagnostics = + + Public Sub ConversionExpression_Implicit_WideningMethodGroupToDelegate_InvalidGenericArguments() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = .Value + + VerifyOperationTreeAndDiagnosticsForTest(Of UnaryExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + #End Region Private Class ExpectedSymbolVerifier diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IEventAssignmentExpression.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IEventAssignmentExpression.vb index 3fb67913e4fba4390448f335fa2c34506995e5f0..5f7fb102b77ed90f2acdf2f984fe0d2260cd1ce7 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IEventAssignmentExpression.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IEventAssignmentExpression.vb @@ -167,6 +167,8 @@ IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: 'Re Handler: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: 'AddressOf M') Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'AddressOf M') + Children(1): + IOperation: (OperationKind.None, IsInvalid) (Syntax: 'M') ]]>.Value Dim expectedDiagnostics = .Value Dim expectedDiagnostics =