Small VBOperationFactory refactor, added assert for IMethodReference in the OperationTreeVerifier.

上级 951634c1
...@@ -608,21 +608,21 @@ Namespace Microsoft.CodeAnalysis.Semantics ...@@ -608,21 +608,21 @@ Namespace Microsoft.CodeAnalysis.Semantics
Private Shared Function IsDelegateCreation(conversionKind As ConversionKind, conversionSyntax As SyntaxNode, operand As BoundNode, targetType As TypeSymbol) As Boolean Private Shared Function IsDelegateCreation(conversionKind As ConversionKind, conversionSyntax As SyntaxNode, operand As BoundNode, targetType As TypeSymbol) As Boolean
' Any of the explicit cast types, as well as New DelegateType(AddressOf Method) ' Any of the explicit cast types, as well as New DelegateType(AddressOf Method)
' Additionally, AddressOf, if the child AddressOf is the same SyntaxNode (ie, an implicit delegate creation) ' Additionally, AddressOf, if the child AddressOf is the same SyntaxNode (ie, an implicit delegate creation)
Dim validAddressOfConversionSyntax = (conversionSyntax.Kind() = SyntaxKind.CTypeExpression OrElse Dim validAddressOfConversionSyntax = operand.Syntax.Kind() = SyntaxKind.AddressOfExpression AndAlso
(conversionSyntax.Kind() = SyntaxKind.CTypeExpression OrElse
conversionSyntax.Kind() = SyntaxKind.DirectCastExpression OrElse conversionSyntax.Kind() = SyntaxKind.DirectCastExpression OrElse
conversionSyntax.Kind() = SyntaxKind.TryCastExpression OrElse conversionSyntax.Kind() = SyntaxKind.TryCastExpression OrElse
conversionSyntax.Kind() = SyntaxKind.ObjectCreationExpression OrElse conversionSyntax.Kind() = SyntaxKind.ObjectCreationExpression OrElse
(conversionSyntax.Kind() = SyntaxKind.AddressOfExpression AndAlso (conversionSyntax.Kind() = SyntaxKind.AddressOfExpression AndAlso
ReferenceEquals(conversionSyntax, operand.Syntax))) AndAlso conversionSyntax Is operand.Syntax))
operand.Syntax.Kind() = SyntaxKind.AddressOfExpression
Dim validLambdaConversionSyntax = operand.Kind = BoundKind.Lambda OrElse Dim validLambdaConversionNode = operand.Kind = BoundKind.Lambda OrElse
operand.Kind = BoundKind.QueryLambda OrElse operand.Kind = BoundKind.QueryLambda OrElse
operand.Kind = BoundKind.UnboundLambda operand.Kind = BoundKind.UnboundLambda
Dim validTargetType = targetType.IsDelegateType() Dim validTargetType = targetType.IsDelegateType()
Return validTargetType AndAlso (validAddressOfConversionSyntax OrElse validLambdaConversionSyntax) Return validTargetType AndAlso (validAddressOfConversionSyntax OrElse validLambdaConversionNode)
End Function End Function
''' <summary> ''' <summary>
......
...@@ -815,6 +815,8 @@ public override void VisitMethodReferenceExpression(IMethodReferenceExpression o ...@@ -815,6 +815,8 @@ public override void VisitMethodReferenceExpression(IMethodReferenceExpression o
LogString(" (IsVirtual)"); LogString(" (IsVirtual)");
} }
Assert.Null(operation.Type);
VisitMemberReferenceExpressionCommon(operation); VisitMemberReferenceExpressionCommon(operation);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册