Skip to content

Commit

Permalink
Merge pull request #21434 from heejaechang/enableAssert2
Browse files Browse the repository at this point in the history
re-enabled asserts that got disabled before
  • Loading branch information
heejaechang authored Aug 14, 2017
2 parents 19bf726 + dfa4309 commit a2840b9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
' e.g. SyntaxKind.MidExpression is handled elsewhere
' NOTE: There were too many "else" cases to justify listing them explicitly and throwing on
' anything unexpected.
'
' PROTOTYPE(IOperation)
' re-enable the assert once this issue is fixed
' https://github.com/dotnet/roslyn/issues/21180
' Debug.Assert(node.ContainsDiagnostics, String.Format("Unexpected {0} syntax does not have diagnostics", node.Kind))
Debug.Assert(IsSemanticModelBinder OrElse node.ContainsDiagnostics, String.Format("Unexpected {0} syntax does not have diagnostics", node.Kind))
Return BadExpression(node, ImmutableArray(Of BoundExpression).Empty, ErrorTypeSymbol.UnknownResultType)

End Select
Expand Down
58 changes: 23 additions & 35 deletions src/Compilers/VisualBasic/Portable/Binding/Binder_Statements.vb
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic

Case SyntaxKind.ElseIfStatement
' ElseIf without a preceding If.
'
' PROTOTYPE(IOperation)
' re-enable the assert once this issue is fixed
' https://github.com/dotnet/roslyn/issues/21180
' Debug.Assert(node.ContainsDiagnostics)
Debug.Assert(IsSemanticModelBinder OrElse node.ContainsDiagnostics)
Dim condition = BindBooleanExpression(DirectCast(node, ElseIfStatementSyntax).Condition, diagnostics)
Return New BoundBadStatement(node, ImmutableArray.Create(Of BoundNode)(condition), hasErrors:=True)

Expand Down Expand Up @@ -200,31 +196,27 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
' where only the ones that can appear in a method body have been selected).
'
' We simply need to ignore this, the error is already created by the parser.
'
' PROTOTYPE(IOperation)
' re-enable the assert once this issue is fixed
' https://github.com/dotnet/roslyn/issues/21180
'Debug.Assert(node.ContainsDiagnostics OrElse
' (node.IsMissing AndAlso
' (node.Parent.Kind = SyntaxKind.MultiLineSubLambdaExpression OrElse
' node.Parent.Kind = SyntaxKind.MultiLineFunctionLambdaExpression OrElse
' node.Parent.Kind = SyntaxKind.AddHandlerAccessorBlock OrElse
' node.Parent.Kind = SyntaxKind.RemoveHandlerAccessorBlock OrElse
' node.Parent.Kind = SyntaxKind.RaiseEventAccessorBlock OrElse
' node.Parent.Kind = SyntaxKind.MultiLineIfBlock OrElse
' node.Parent.Kind = SyntaxKind.ElseIfBlock OrElse
' node.Parent.Kind = SyntaxKind.ElseBlock OrElse
' node.Parent.Kind = SyntaxKind.SimpleDoLoopBlock OrElse
' node.Parent.Kind = SyntaxKind.DoWhileLoopBlock OrElse
' node.Parent.Kind = SyntaxKind.DoUntilLoopBlock OrElse
' node.Parent.Kind = SyntaxKind.WhileBlock OrElse
' node.Parent.Kind = SyntaxKind.WithBlock OrElse
' node.Parent.Kind = SyntaxKind.ForBlock OrElse
' node.Parent.Kind = SyntaxKind.ForEachBlock OrElse
' node.Parent.Kind = SyntaxKind.SyncLockBlock OrElse
' node.Parent.Kind = SyntaxKind.SelectBlock OrElse
' node.Parent.Kind = SyntaxKind.TryBlock OrElse
' node.Parent.Kind = SyntaxKind.UsingBlock)))
Debug.Assert(IsSemanticModelBinder OrElse node.ContainsDiagnostics OrElse
(node.IsMissing AndAlso
(node.Parent.Kind = SyntaxKind.MultiLineSubLambdaExpression OrElse
node.Parent.Kind = SyntaxKind.MultiLineFunctionLambdaExpression OrElse
node.Parent.Kind = SyntaxKind.AddHandlerAccessorBlock OrElse
node.Parent.Kind = SyntaxKind.RemoveHandlerAccessorBlock OrElse
node.Parent.Kind = SyntaxKind.RaiseEventAccessorBlock OrElse
node.Parent.Kind = SyntaxKind.MultiLineIfBlock OrElse
node.Parent.Kind = SyntaxKind.ElseIfBlock OrElse
node.Parent.Kind = SyntaxKind.ElseBlock OrElse
node.Parent.Kind = SyntaxKind.SimpleDoLoopBlock OrElse
node.Parent.Kind = SyntaxKind.DoWhileLoopBlock OrElse
node.Parent.Kind = SyntaxKind.DoUntilLoopBlock OrElse
node.Parent.Kind = SyntaxKind.WhileBlock OrElse
node.Parent.Kind = SyntaxKind.WithBlock OrElse
node.Parent.Kind = SyntaxKind.ForBlock OrElse
node.Parent.Kind = SyntaxKind.ForEachBlock OrElse
node.Parent.Kind = SyntaxKind.SyncLockBlock OrElse
node.Parent.Kind = SyntaxKind.SelectBlock OrElse
node.Parent.Kind = SyntaxKind.TryBlock OrElse
node.Parent.Kind = SyntaxKind.UsingBlock)))

Return New BoundBadStatement(node, ImmutableArray(Of BoundNode).Empty, hasErrors:=True)

Expand Down Expand Up @@ -272,11 +264,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
' not handling here and then throwing ExceptionUtilities.UnexpectedValue in the else case, but
' there are just too many statement SyntaxKinds in VB (e.g. declarations, statements corresponding
' to blocks handled above, etc).
'
' PROTOTYPE(IOperation)
' re-enable the assert once this issue is fixed
' https://github.com/dotnet/roslyn/issues/21180
' Debug.Assert(node.ContainsDiagnostics)
Debug.Assert(IsSemanticModelBinder OrElse node.ContainsDiagnostics)
Return New BoundBadStatement(node, ImmutableArray(Of BoundNode).Empty, hasErrors:=True)
End Function

Expand Down

0 comments on commit a2840b9

Please sign in to comment.