diff --git a/src/Compilers/VisualBasic/Portable/Syntax/LambdaUtilities.vb b/src/Compilers/VisualBasic/Portable/Syntax/LambdaUtilities.vb index 988a58c6e102aa738c6e7fe65ca3aef3d51b2bcf..4ff2c292174bbe768b31e59a9b042b28e57eaa9d 100644 --- a/src/Compilers/VisualBasic/Portable/Syntax/LambdaUtilities.vb +++ b/src/Compilers/VisualBasic/Portable/Syntax/LambdaUtilities.vb @@ -88,7 +88,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Return If(oldJoinCondition.Left Is oldBody, GetJoinLeftLambdaBody(newJoinClause), GetJoinRightLambdaBody(newJoinClause)) Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(oldLambda.Kind) End Select End Function @@ -587,7 +587,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Return DirectCast(clause, JoinClauseSyntax).JoinedVariables Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(clause.Kind) End Select End Function diff --git a/src/EditorFeatures/CSharp/AutomaticCompletion/CSharpBraceCompletionSessionProvider.cs b/src/EditorFeatures/CSharp/AutomaticCompletion/CSharpBraceCompletionSessionProvider.cs index 4ffe6fd322985102c9a21eb22714a84bc004d83a..231390b5ada8cc0e9719ce61720d9470b94460b0 100644 --- a/src/EditorFeatures/CSharp/AutomaticCompletion/CSharpBraceCompletionSessionProvider.cs +++ b/src/EditorFeatures/CSharp/AutomaticCompletion/CSharpBraceCompletionSessionProvider.cs @@ -80,9 +80,9 @@ protected override IEditorBraceCompletionSession CreateEditorSession(Document do case BraceCompletionSessionProvider.Parenthesis.OpenCharacter: return new ParenthesisCompletionSession(syntaxFactsService); case BraceCompletionSessionProvider.SingleQuote.OpenCharacter: return new CharLiteralCompletionSession(syntaxFactsService); case BraceCompletionSessionProvider.LessAndGreaterThan.OpenCharacter: return new LessAndGreaterThanCompletionSession(syntaxFactsService); + default: + throw ExceptionUtilities.UnexpectedValue(openingBrace); } - - throw ExceptionUtilities.Unreachable; } } } diff --git a/src/EditorFeatures/Core/Implementation/InlineRename/IEditorInlineRenameService.cs b/src/EditorFeatures/Core/Implementation/InlineRename/IEditorInlineRenameService.cs index bd2fd28f35f251285a45b917ed56643e2ede99dc..7d006aaa9701e4a4205455d619db114a3088d910 100644 --- a/src/EditorFeatures/Core/Implementation/InlineRename/IEditorInlineRenameService.cs +++ b/src/EditorFeatures/Core/Implementation/InlineRename/IEditorInlineRenameService.cs @@ -67,7 +67,7 @@ private static InlineRenameReplacementKind GetReplacementKind(RelatedLocation lo return InlineRenameReplacementKind.UnresolvedConflict; default: case RelatedLocationType.PossiblyResolvableConflict: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(location.Type); } } } diff --git a/src/EditorFeatures/Core/Implementation/InlineRename/InlineRenameSession.OpenTextBufferManager.cs b/src/EditorFeatures/Core/Implementation/InlineRename/InlineRenameSession.OpenTextBufferManager.cs index 0128fd594060225cc5688e1a38b679edbe6d00c7..7a7af903349ace5391d54051a20e322cfe493ab3 100644 --- a/src/EditorFeatures/Core/Implementation/InlineRename/InlineRenameSession.OpenTextBufferManager.cs +++ b/src/EditorFeatures/Core/Implementation/InlineRename/InlineRenameSession.OpenTextBufferManager.cs @@ -553,7 +553,7 @@ private static RenameSpanKind GetRenameSpanKind(InlineRenameReplacementKind kind return RenameSpanKind.Complexified; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(kind); } } diff --git a/src/EditorFeatures/Core/Implementation/InlineRename/Taggers/RenameTagger.cs b/src/EditorFeatures/Core/Implementation/InlineRename/Taggers/RenameTagger.cs index da4d2c228612215a4d93ebac9ebde2003cfbf0aa..7830137376121a9b20e24739606fa276a9015730 100644 --- a/src/EditorFeatures/Core/Implementation/InlineRename/Taggers/RenameTagger.cs +++ b/src/EditorFeatures/Core/Implementation/InlineRename/Taggers/RenameTagger.cs @@ -30,7 +30,7 @@ protected override bool TryCreateTagSpan(SnapshotSpan span, RenameSpanKind type, tagKind = FixupTag.Instance; break; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(type); } tagSpan = new TagSpan(span, tagKind); diff --git a/src/EditorFeatures/Core/Implementation/IntelliSense/Completion/FileSystem/FileSystemCompletionHelper.cs b/src/EditorFeatures/Core/Implementation/IntelliSense/Completion/FileSystem/FileSystemCompletionHelper.cs index 3d7af0a42496ef63cd891441788f762cb81f9243..e334b9a4a8896a7f398f3b8d1e75ad3bd5485a0a 100644 --- a/src/EditorFeatures/Core/Implementation/IntelliSense/Completion/FileSystem/FileSystemCompletionHelper.cs +++ b/src/EditorFeatures/Core/Implementation/IntelliSense/Completion/FileSystem/FileSystemCompletionHelper.cs @@ -161,7 +161,7 @@ private ImmutableArray GetFilesAndDirectories(string path, strin break; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(pathKind); } return result.ToImmutableAndFree(); diff --git a/src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Presentation/ClassificationTags.cs b/src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Presentation/ClassificationTags.cs index 5692e24b40493900be8c26eda81289fa2beb4d6d..54d3b188d106a54093823bcbcc55f4c65f824672 100644 --- a/src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Presentation/ClassificationTags.cs +++ b/src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Presentation/ClassificationTags.cs @@ -69,7 +69,7 @@ public static string GetClassificationTypeName(string textTag) return ClassificationTypeNames.Text; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(textTag); } } } diff --git a/src/EditorFeatures/VisualBasic/AutomaticCompletion/VisualBasicBraceCompletionSessionProvider.vb b/src/EditorFeatures/VisualBasic/AutomaticCompletion/VisualBasicBraceCompletionSessionProvider.vb index a8a18994b4d7f627ed85049512e744ab83f7f11c..567634ffc0713270f91c3316828e44fe5123113c 100644 --- a/src/EditorFeatures/VisualBasic/AutomaticCompletion/VisualBasicBraceCompletionSessionProvider.vb +++ b/src/EditorFeatures/VisualBasic/AutomaticCompletion/VisualBasicBraceCompletionSessionProvider.vb @@ -63,10 +63,9 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.AutomaticCompletion Else Return New StringLiteralCompletionSession(syntaxFactsService) End If - + Case Else + Throw ExceptionUtilities.UnexpectedValue(openingBrace) End Select - - Throw ExceptionUtilities.Unreachable End Function End Class End Namespace diff --git a/src/Features/CSharp/Portable/CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs b/src/Features/CSharp/Portable/CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs index 677af21eafa8b0f7fd709647cd6ad0a50dfead79..2961e81906bc20e865ca0912dbf24f3575b03db6 100644 --- a/src/Features/CSharp/Portable/CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs @@ -101,7 +101,7 @@ internal static string GetCodeActionId(string diagnosticId, string nodeText) return CSharpFeaturesResources.Remove_this_qualification; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(diagnosticId); } } diff --git a/src/Features/CSharp/Portable/EditAndContinue/CSharpEditAndContinueAnalyzer.cs b/src/Features/CSharp/Portable/EditAndContinue/CSharpEditAndContinueAnalyzer.cs index 1dd454493181bcc83837ca5c1190521d1d6f2c5f..987a21976399192bdda1ebfded6cf5835bb3ee89 100644 --- a/src/Features/CSharp/Portable/EditAndContinue/CSharpEditAndContinueAnalyzer.cs +++ b/src/Features/CSharp/Portable/EditAndContinue/CSharpEditAndContinueAnalyzer.cs @@ -1725,7 +1725,7 @@ public void ClassifyEdit() return; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(_kind); } } @@ -1793,7 +1793,7 @@ private void ClassifyReorder(SyntaxNode oldNode, SyntaxNode newNode) return; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(newNode.Kind()); } } @@ -2209,7 +2209,7 @@ private void ClassifyUpdate(SyntaxNode oldNode, SyntaxNode newNode) return; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(newNode.Kind()); } } @@ -3039,7 +3039,7 @@ private static ExpressionSyntax GetExpressionFromStatementPart(SyntaxNode statem return ((ReturnStatementSyntax)statement).Expression; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(statement.Kind()); } } diff --git a/src/Features/CSharp/Portable/EditAndContinue/StatementSyntaxComparer.cs b/src/Features/CSharp/Portable/EditAndContinue/StatementSyntaxComparer.cs index c3f3cf27057e2cd6409f918815f81f3569492054..78c3d74277fc339320d7465b55303e1107b7ab97 100644 --- a/src/Features/CSharp/Portable/EditAndContinue/StatementSyntaxComparer.cs +++ b/src/Features/CSharp/Portable/EditAndContinue/StatementSyntaxComparer.cs @@ -740,7 +740,7 @@ private static void GetLambdaParts(SyntaxNode lambda, out IEnumerable _title; @@ -65,9 +65,9 @@ private Editor GetEditor(CancellationToken cancellationToken) return new RenameTypeEditor(_service, _state, _fileName, cancellationToken); case OperationKind.RenameFile: return new RenameFileEditor(_service, _state, _fileName, cancellationToken); + default: + throw ExceptionUtilities.UnexpectedValue(_operationKind); } - - throw ExceptionUtilities.Unreachable; } internal override bool PerformFinalApplicabilityCheck => true; diff --git a/src/Features/Core/Portable/Common/TaggedText.cs b/src/Features/Core/Portable/Common/TaggedText.cs index 9ea789860a4067515fa6068e2a2b682c55f16b2f..f3ee7980342481fa5c9a81ed6cf51de84f317129 100644 --- a/src/Features/Core/Portable/Common/TaggedText.cs +++ b/src/Features/Core/Portable/Common/TaggedText.cs @@ -139,7 +139,7 @@ public static string ToClassificationTypeName(this string taggedTextTag) return ClassificationTypeNames.Text; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(taggedTextTag); } } diff --git a/src/Features/Core/Portable/Completion/Providers/AbstractOverrideCompletionProvider.cs b/src/Features/Core/Portable/Completion/Providers/AbstractOverrideCompletionProvider.cs index e8ea96a65fa0585e5f91e490d12e274d4e1ac7c8..3f41d02b2869838c23263b917d72d495b5672119 100644 --- a/src/Features/Core/Portable/Completion/Providers/AbstractOverrideCompletionProvider.cs +++ b/src/Features/Core/Portable/Completion/Providers/AbstractOverrideCompletionProvider.cs @@ -112,7 +112,7 @@ protected ITypeSymbol GetReturnType(ISymbol symbol) case SymbolKind.Property: return ((IPropertySymbol)symbol).Type; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(symbol.Kind); } } } diff --git a/src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs b/src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs index 3150bf33f05f32805e205892c1f390ccfe5494da..c5529b2a81153bb1c4b6d5d14929826a13f422d9 100644 --- a/src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs +++ b/src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs @@ -85,7 +85,7 @@ public static ReportDiagnostic MapSeverityToReport(this DiagnosticSeverity sever case DiagnosticSeverity.Error: return ReportDiagnostic.Error; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(severity); } } diff --git a/src/Features/Core/Portable/Diagnostics/Analyzers/SimplifyTypeNamesDiagnosticAnalyzerBase.cs b/src/Features/Core/Portable/Diagnostics/Analyzers/SimplifyTypeNamesDiagnosticAnalyzerBase.cs index bd1eb042be48604e59e13d487bd880a446ec95a1..cda34277c5b9fd681c539f96c4cb9cbc7450a431 100644 --- a/src/Features/Core/Portable/Diagnostics/Analyzers/SimplifyTypeNamesDiagnosticAnalyzerBase.cs +++ b/src/Features/Core/Portable/Diagnostics/Analyzers/SimplifyTypeNamesDiagnosticAnalyzerBase.cs @@ -147,7 +147,7 @@ protected bool TrySimplifyTypeNameExpression(SemanticModel model, SyntaxNode nod break; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(diagnosticId); } if (descriptor == null) diff --git a/src/Features/Core/Portable/EditAndContinue/AbstractEditAndContinueAnalyzer.cs b/src/Features/Core/Portable/EditAndContinue/AbstractEditAndContinueAnalyzer.cs index 0d9a1321d7808c2c39a0920dfe8623c1a07c4e6d..e254c56be1c1a76342c9f3223898008f508fde9a 100644 --- a/src/Features/Core/Portable/EditAndContinue/AbstractEditAndContinueAnalyzer.cs +++ b/src/Features/Core/Portable/EditAndContinue/AbstractEditAndContinueAnalyzer.cs @@ -2117,7 +2117,7 @@ public ConstructorEdit(INamedTypeSymbol oldType) { case EditKind.Move: // Move is always a Rude Edit. - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(edit.Kind); case EditKind.Delete: { @@ -2382,7 +2382,7 @@ public ConstructorEdit(INamedTypeSymbol oldType) break; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(edit.Kind); } semanticEdits.Add(new SemanticEdit(editKind, oldSymbol, newSymbol, syntaxMapOpt, preserveLocalVariables: syntaxMapOpt != null)); diff --git a/src/Features/Core/Portable/GenerateMember/GenerateParameterizedMember/AbstractGenerateParameterizedMemberService.CodeAction.cs b/src/Features/Core/Portable/GenerateMember/GenerateParameterizedMember/AbstractGenerateParameterizedMemberService.CodeAction.cs index ccee7fe39a1464e9e13e2d05748deb4944e7c4c9..b26b86b8de941317ba769c7a2802bb69fe619209 100644 --- a/src/Features/Core/Portable/GenerateMember/GenerateParameterizedMember/AbstractGenerateParameterizedMemberService.CodeAction.cs +++ b/src/Features/Core/Portable/GenerateMember/GenerateParameterizedMember/AbstractGenerateParameterizedMemberService.CodeAction.cs @@ -55,7 +55,7 @@ private partial class GenerateParameterizedMemberCodeAction : CodeAction case MethodGenerationKind.ExplicitConversion: return _service.GetExplicitConversionDisplayText(_state); default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(state.MethodGenerationKind); } } diff --git a/src/Features/Core/Portable/MetadataAsSource/AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs b/src/Features/Core/Portable/MetadataAsSource/AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs index de88ffa2ad1422fe0f4ef74054363169ad3c62ba..80056d64221eeb66620150bfea94c902f9e429ea 100644 --- a/src/Features/Core/Portable/MetadataAsSource/AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs +++ b/src/Features/Core/Portable/MetadataAsSource/AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs @@ -55,9 +55,10 @@ private static ISymbol WrapMember(ISymbol m, bool canImplementImplicitly, IDocum case SymbolKind.Property: return new WrappedPropertySymbol((IPropertySymbol)m, canImplementImplicitly, docCommentFormattingService); - } - throw ExceptionUtilities.Unreachable; + default: + throw ExceptionUtilities.UnexpectedValue(m.Kind); + } } public bool IsAnonymousType => _symbol.IsAnonymousType; diff --git a/src/Features/Core/Portable/QualifyMemberAccess/AbstractQualifyMemberAccessDiagnosticAnalyzer.cs b/src/Features/Core/Portable/QualifyMemberAccess/AbstractQualifyMemberAccessDiagnosticAnalyzer.cs index 5e6295d4faa539bdb150e83982102261d8137a3a..812a272c4fcc2b12f253fa44a70ce03e5e397791 100644 --- a/src/Features/Core/Portable/QualifyMemberAccess/AbstractQualifyMemberAccessDiagnosticAnalyzer.cs +++ b/src/Features/Core/Portable/QualifyMemberAccess/AbstractQualifyMemberAccessDiagnosticAnalyzer.cs @@ -113,7 +113,7 @@ internal static PerLanguageOption> GetApplicableOptionFrom case SymbolKind.Event: return CodeStyleOptions.QualifyEventAccess; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(symbolKind); } } } diff --git a/src/Features/Core/Portable/SolutionCrawler/WorkCoordinator.cs b/src/Features/Core/Portable/SolutionCrawler/WorkCoordinator.cs index d9b994722807e57f5405edce0c1c1a7393809d14..c30fd33616b049d77c11d42db65eb4e471e92397 100644 --- a/src/Features/Core/Portable/SolutionCrawler/WorkCoordinator.cs +++ b/src/Features/Core/Portable/SolutionCrawler/WorkCoordinator.cs @@ -248,7 +248,7 @@ private void ProcessEvents(WorkspaceChangeEventArgs args, IAsyncToken asyncToken ProcessDocumentEvent(args, asyncToken); break; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(args.Kind); } } @@ -290,7 +290,7 @@ private void ProcessDocumentEvent(WorkspaceChangeEventArgs e, IAsyncToken asyncT break; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(e.Kind); } } @@ -310,7 +310,7 @@ private void ProcessProjectEvent(WorkspaceChangeEventArgs e, IAsyncToken asyncTo EnqueueEvent(e.OldSolution, e.NewSolution, e.ProjectId, asyncToken); break; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(e.Kind); } } @@ -333,7 +333,7 @@ private void ProcessSolutionEvent(WorkspaceChangeEventArgs e, IAsyncToken asyncT EnqueueEvent(e.OldSolution, e.NewSolution, asyncToken); break; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(e.Kind); } } diff --git a/src/Features/VisualBasic/Portable/CodeFixes/IncorrectExitContinue/IncorrectExitContinueCodeFixProvider.vb b/src/Features/VisualBasic/Portable/CodeFixes/IncorrectExitContinue/IncorrectExitContinueCodeFixProvider.vb index 1d524a69090f95cd2bc5c9ab4c150b2ce0217455..8a082c3e50aabe083db7c764815d410039468662 100644 --- a/src/Features/VisualBasic/Portable/CodeFixes/IncorrectExitContinue/IncorrectExitContinueCodeFixProvider.vb +++ b/src/Features/VisualBasic/Portable/CodeFixes/IncorrectExitContinue/IncorrectExitContinueCodeFixProvider.vb @@ -267,7 +267,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeFixes.IncorrectExitContinue Case SyntaxKind.GetAccessorBlock, SyntaxKind.SetAccessorBlock Return SyntaxKind.ExitPropertyStatement Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(blockKind) End Select End Function @@ -284,7 +284,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeFixes.IncorrectExitContinue Case SyntaxKind.WhileBlock Return SyntaxKind.ContinueWhileStatement Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(blockKind) End Select End Function diff --git a/src/Features/VisualBasic/Portable/CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.vb b/src/Features/VisualBasic/Portable/CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.vb index 4231cca7ff0d68f9eb4d167017e9d0c725e774cb..ee9f485e8176847061d11e04dd3928f1bdddc6ae 100644 --- a/src/Features/VisualBasic/Portable/CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.vb +++ b/src/Features/VisualBasic/Portable/CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.vb @@ -88,7 +88,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeFixes.SimplifyTypeNames Return String.Format(VBFeaturesResources.Simplify_member_access_0, nodeText) Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(simplifyDiagnosticId) End Select End Function diff --git a/src/Features/VisualBasic/Portable/Completion/KeywordRecommenders/RecommendationHelpers.vb b/src/Features/VisualBasic/Portable/Completion/KeywordRecommenders/RecommendationHelpers.vb index 0ed3a9123965113b962034d7e7c1920a5342ed71..b60216469e25d6c2c5604fb0ccff5e0a7259999a 100644 --- a/src/Features/VisualBasic/Portable/Completion/KeywordRecommenders/RecommendationHelpers.vb +++ b/src/Features/VisualBasic/Portable/Completion/KeywordRecommenders/RecommendationHelpers.vb @@ -51,7 +51,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.KeywordRecommenders arrayCreation.Initializer.CloseBraceToken, asNewClause.Type.GetLastToken(includeZeroWidth:=True)) Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(asNewClause.NewExpression.Kind) End Select Return token = lastToken diff --git a/src/Features/VisualBasic/Portable/Diagnostics/Analyzers/VisualBasicRemoveUnnecessaryCastDiagnosticAnalyzer.vb b/src/Features/VisualBasic/Portable/Diagnostics/Analyzers/VisualBasicRemoveUnnecessaryCastDiagnosticAnalyzer.vb index aa86a17c5a348fee610eee1901f7cc540b736309..c1f108c9c17535d874f3f25497625cdea61359b6 100644 --- a/src/Features/VisualBasic/Portable/Diagnostics/Analyzers/VisualBasicRemoveUnnecessaryCastDiagnosticAnalyzer.vb +++ b/src/Features/VisualBasic/Portable/Diagnostics/Analyzers/VisualBasicRemoveUnnecessaryCastDiagnosticAnalyzer.vb @@ -30,7 +30,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Diagnostics.RemoveUnnecessaryCast Case SyntaxKind.PredefinedCastExpression Return DirectCast(node, PredefinedCastExpressionSyntax).IsUnnecessaryCast(model, assumeCallKeyword:=True, cancellationToken:=cancellationToken) Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(node.Kind) End Select End Function @@ -41,7 +41,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Diagnostics.RemoveUnnecessaryCast Case SyntaxKind.PredefinedCastExpression Return DirectCast(node, PredefinedCastExpressionSyntax).Keyword.Span Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(node.Kind) End Select End Function End Class diff --git a/src/Features/VisualBasic/Portable/EditAndContinue/VisualBasicEditAndContinueAnalyzer.vb b/src/Features/VisualBasic/Portable/EditAndContinue/VisualBasicEditAndContinueAnalyzer.vb index 1499657ef8917056d53613e479fefb4dd11312d5..4b2b269fd7316ff05284824c9599affbe6684c00 100644 --- a/src/Features/VisualBasic/Portable/EditAndContinue/VisualBasicEditAndContinueAnalyzer.vb +++ b/src/Features/VisualBasic/Portable/EditAndContinue/VisualBasicEditAndContinueAnalyzer.vb @@ -1437,7 +1437,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue endToken = header.DeclarationKeyword Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(header.Kind) End Select End If @@ -1786,7 +1786,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue Return Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(_kind) End Select End Sub @@ -1865,7 +1865,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue Return Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(newNode.Kind) End Select End Sub @@ -2167,7 +2167,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue Return Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(oldNode.Kind) End Select End Sub @@ -2339,7 +2339,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue Return Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(newNode.Kind) End Select End Sub @@ -3093,7 +3093,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue Return DirectCast(statement, ReturnStatementSyntax).Expression Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(statement.Kind()) End Select End Function diff --git a/src/VisualStudio/Core/Def/Implementation/EditAndContinue/VsENCRebuildableProjectImpl.cs b/src/VisualStudio/Core/Def/Implementation/EditAndContinue/VsENCRebuildableProjectImpl.cs index bed088270c8d9d24e26b3e3f26d4a362860c06e2..980253103d05839fae276a26860c7853ad0f5d92 100644 --- a/src/VisualStudio/Core/Def/Implementation/EditAndContinue/VsENCRebuildableProjectImpl.cs +++ b/src/VisualStudio/Core/Def/Implementation/EditAndContinue/VsENCRebuildableProjectImpl.cs @@ -859,7 +859,7 @@ public int GetENCBuildState(ShellInterop.ENC_BUILD_STATE[] pENCBuildState) break; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(_lastEditSessionSummary); } log.Write("EnC state of '{0}' queried: {1}{2}", diff --git a/src/VisualStudio/Core/Def/Implementation/Progression/GraphBuilder.cs b/src/VisualStudio/Core/Def/Implementation/Progression/GraphBuilder.cs index ffe0c3f9b0cedf3af3f8a8db2047cdbd624427e2..bdda5c345c687ab6493b05e1fc888bfa9ca74fd4 100644 --- a/src/VisualStudio/Core/Def/Implementation/Progression/GraphBuilder.cs +++ b/src/VisualStudio/Core/Def/Implementation/Progression/GraphBuilder.cs @@ -589,7 +589,7 @@ private static async Task GetOrCreateNodeForNamedTypeAsync(Graph grap break; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(namedType.TypeKind); } node[DgmlNodeProperties.Icon] = IconHelper.GetIconName(iconGroupName, namedType.DeclaredAccessibility); diff --git a/src/VisualStudio/VisualBasic/Impl/ProjectSystemShim/VisualBasicProjectOptionsHelper.vb b/src/VisualStudio/VisualBasic/Impl/ProjectSystemShim/VisualBasicProjectOptionsHelper.vb index e2b5553abd43d165a5261000fd33c72cf997d232..6bfed4965a884ea027503f73f4d7c7b6d2b76d73 100644 --- a/src/VisualStudio/VisualBasic/Impl/ProjectSystemShim/VisualBasicProjectOptionsHelper.vb +++ b/src/VisualStudio/VisualBasic/Impl/ProjectSystemShim/VisualBasicProjectOptionsHelper.vb @@ -267,7 +267,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.ProjectSystemShim Return ReportDiagnostic.Error Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(level) End Select End Function diff --git a/src/Workspaces/CSharp/Portable/Extensions/BaseParameterListSyntaxExtensions.cs b/src/Workspaces/CSharp/Portable/Extensions/BaseParameterListSyntaxExtensions.cs index 68ae6e63515f8a1c1209b2d25e54ddd0c80ddee5..ff29b1e721b30fd2b915c604b0df4608b7b9b31d 100644 --- a/src/Workspaces/CSharp/Portable/Extensions/BaseParameterListSyntaxExtensions.cs +++ b/src/Workspaces/CSharp/Portable/Extensions/BaseParameterListSyntaxExtensions.cs @@ -20,9 +20,9 @@ internal static class BaseParameterListSyntaxExtensions return ((BracketedParameterListSyntax)parameterList).WithParameters(parameters); case SyntaxKind.ParameterList: return ((ParameterListSyntax)parameterList).WithParameters(parameters); + default: + throw ExceptionUtilities.UnexpectedValue(parameterList.Kind()); } - - throw ExceptionUtilities.Unreachable; } } } diff --git a/src/Workspaces/CSharp/Portable/Extensions/TypeDeclarationSyntaxExtensions.cs b/src/Workspaces/CSharp/Portable/Extensions/TypeDeclarationSyntaxExtensions.cs index 02687a895bac4e49347b10d6372a81653df46783..49e4788c374c9bcc267b1c7cc42f634337a4ab7d 100644 --- a/src/Workspaces/CSharp/Portable/Extensions/TypeDeclarationSyntaxExtensions.cs +++ b/src/Workspaces/CSharp/Portable/Extensions/TypeDeclarationSyntaxExtensions.cs @@ -26,9 +26,9 @@ internal static class TypeDeclarationSyntaxExtensions return ((InterfaceDeclarationSyntax)node).AddMembers(members); case SyntaxKind.StructDeclaration: return ((StructDeclarationSyntax)node).AddMembers(members); + default: + throw ExceptionUtilities.UnexpectedValue(node.Kind()); } - - throw ExceptionUtilities.Unreachable; } public static TypeDeclarationSyntax WithMembers( @@ -42,9 +42,9 @@ internal static class TypeDeclarationSyntaxExtensions return ((InterfaceDeclarationSyntax)node).WithMembers(members); case SyntaxKind.StructDeclaration: return ((StructDeclarationSyntax)node).WithMembers(members); + default: + throw ExceptionUtilities.UnexpectedValue(node.Kind()); } - - throw ExceptionUtilities.Unreachable; } public static TypeDeclarationSyntax WithAttributeLists( @@ -58,9 +58,9 @@ internal static class TypeDeclarationSyntaxExtensions return ((InterfaceDeclarationSyntax)node).WithAttributeLists(attributes); case SyntaxKind.StructDeclaration: return ((StructDeclarationSyntax)node).WithAttributeLists(attributes); + default: + throw ExceptionUtilities.UnexpectedValue(node.Kind()); } - - throw ExceptionUtilities.Unreachable; } public static TypeDeclarationSyntax WithIdentifier( @@ -74,9 +74,9 @@ internal static class TypeDeclarationSyntaxExtensions return ((InterfaceDeclarationSyntax)node).WithIdentifier(identifier); case SyntaxKind.StructDeclaration: return ((StructDeclarationSyntax)node).WithIdentifier(identifier); + default: + throw ExceptionUtilities.UnexpectedValue(node.Kind()); } - - throw ExceptionUtilities.Unreachable; } public static TypeDeclarationSyntax WithModifiers( @@ -90,9 +90,9 @@ internal static class TypeDeclarationSyntaxExtensions return ((InterfaceDeclarationSyntax)node).WithModifiers(modifiers); case SyntaxKind.StructDeclaration: return ((StructDeclarationSyntax)node).WithModifiers(modifiers); + default: + throw ExceptionUtilities.UnexpectedValue(node.Kind()); } - - throw ExceptionUtilities.Unreachable; } public static TypeDeclarationSyntax WithTypeParameterList( @@ -106,9 +106,9 @@ internal static class TypeDeclarationSyntaxExtensions return ((InterfaceDeclarationSyntax)node).WithTypeParameterList(list); case SyntaxKind.StructDeclaration: return ((StructDeclarationSyntax)node).WithTypeParameterList(list); + default: + throw ExceptionUtilities.UnexpectedValue(node.Kind()); } - - throw ExceptionUtilities.Unreachable; } public static TypeDeclarationSyntax WithBaseList( @@ -122,9 +122,9 @@ internal static class TypeDeclarationSyntaxExtensions return ((InterfaceDeclarationSyntax)node).WithBaseList(list); case SyntaxKind.StructDeclaration: return ((StructDeclarationSyntax)node).WithBaseList(list); + default: + throw ExceptionUtilities.UnexpectedValue(node.Kind()); } - - throw ExceptionUtilities.Unreachable; } public static TypeDeclarationSyntax WithConstraintClauses( @@ -138,9 +138,9 @@ internal static class TypeDeclarationSyntaxExtensions return ((InterfaceDeclarationSyntax)node).WithConstraintClauses(constraintClauses); case SyntaxKind.StructDeclaration: return ((StructDeclarationSyntax)node).WithConstraintClauses(constraintClauses); + default: + throw ExceptionUtilities.UnexpectedValue(node.Kind()); } - - throw ExceptionUtilities.Unreachable; } public static TypeDeclarationSyntax WithOpenBraceToken( @@ -154,9 +154,9 @@ internal static class TypeDeclarationSyntaxExtensions return ((InterfaceDeclarationSyntax)node).WithOpenBraceToken(openBrace); case SyntaxKind.StructDeclaration: return ((StructDeclarationSyntax)node).WithOpenBraceToken(openBrace); + default: + throw ExceptionUtilities.UnexpectedValue(node.Kind()); } - - throw ExceptionUtilities.Unreachable; } public static TypeDeclarationSyntax WithCloseBraceToken( @@ -170,9 +170,9 @@ internal static class TypeDeclarationSyntaxExtensions return ((InterfaceDeclarationSyntax)node).WithCloseBraceToken(closeBrace); case SyntaxKind.StructDeclaration: return ((StructDeclarationSyntax)node).WithCloseBraceToken(closeBrace); + default: + throw ExceptionUtilities.UnexpectedValue(node.Kind()); } - - throw ExceptionUtilities.Unreachable; } public static IList GetInsertionIndices(this TypeDeclarationSyntax destination, CancellationToken cancellationToken) diff --git a/src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/FixAllState.cs b/src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/FixAllState.cs index a529942a91bd9e7289c3d4f59e3ea7d69a87e2bb..5389493be480cf5662a3f09f4bf42886fb1ba6f2 100644 --- a/src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/FixAllState.cs +++ b/src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/FixAllState.cs @@ -185,7 +185,7 @@ internal string GetDefaultFixAllTitle() return string.Format(WorkspacesResources.Fix_all_0_in_Solution, diagnosticId); default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(this.Scope); } } diff --git a/src/Workspaces/Core/Portable/Formatting/Rules/BaseIndentationFormattingRule.cs b/src/Workspaces/Core/Portable/Formatting/Rules/BaseIndentationFormattingRule.cs index f441fbfc6b13268be15c78f662d2c4f1d4262710..114bd8fe490fc2397d6ec02faf8524e01d8c7398 100644 --- a/src/Workspaces/Core/Portable/Formatting/Rules/BaseIndentationFormattingRule.cs +++ b/src/Workspaces/Core/Portable/Formatting/Rules/BaseIndentationFormattingRule.cs @@ -122,7 +122,7 @@ private IndentBlockOperation CloneAndAdjustFormattingOperation(IndentBlockOperat case IndentBlockOption.AbsolutePosition: return FormattingOperations.CreateIndentBlockOperation(operation.StartToken, operation.EndToken, AdjustTextSpan(operation.TextSpan), operation.IndentationDeltaOrPosition, operation.Option); default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(operation.Option); } } diff --git a/src/Workspaces/Core/Portable/Formatting/TriviaEngine/AbstractTriviaFormatter.cs b/src/Workspaces/Core/Portable/Formatting/TriviaEngine/AbstractTriviaFormatter.cs index ebbf5e6451bdf30c4b51d4dd2d4efc58c1e514aa..90ab1bce99a0bcec8712ae5f3b1d538f6cfd0e65 100644 --- a/src/Workspaces/Core/Portable/Formatting/TriviaEngine/AbstractTriviaFormatter.cs +++ b/src/Workspaces/Core/Portable/Formatting/TriviaEngine/AbstractTriviaFormatter.cs @@ -404,7 +404,7 @@ private LineColumnRule GetOverallLineColumnRuleBetween(SyntaxTrivia trivia1, Lin break; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(lineOperation.Option); } } @@ -556,7 +556,7 @@ private bool FirstLineBlank() return existingWhitespaceBetween.Spaces; default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(rule.IndentationOperation); } } @@ -570,7 +570,7 @@ private bool FirstLineBlank() return Math.Max(rule.Spaces, 0); default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(rule.SpaceOperation); } } diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions_Accessibility.cs b/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions_Accessibility.cs index c945a7bc5235d52ca65c49efc01305267649a2f3..a2421041aa4ada6ef3828e8fa8806bb1805109a1 100644 --- a/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions_Accessibility.cs +++ b/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions_Accessibility.cs @@ -150,7 +150,7 @@ internal static partial class ISymbolExtensions return IsMemberAccessible(symbol.ContainingType, symbol.DeclaredAccessibility, within, throughTypeOpt, out failedThroughTypeCheck); default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(symbol.Kind); } } @@ -221,7 +221,7 @@ private static bool IsNamedTypeAccessible(INamedTypeSymbol type, ISymbol within) return withinAssembly.IsSameAssemblyOrHasFriendAccessTo(assembly); default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(declaredAccessibility); } } @@ -307,7 +307,7 @@ private static bool IsNamedTypeAccessible(INamedTypeSymbol type, ISymbol within) return IsProtectedSymbolAccessible(withinNamedType, withinAssembly, throughTypeOpt, originalContainingType, out failedThroughTypeCheck); default: - throw ExceptionUtilities.Unreachable; + throw ExceptionUtilities.UnexpectedValue(declaredAccessibility); } } diff --git a/src/Workspaces/VisualBasic/Portable/CodeCleanup/Providers/ReduceTokensCodeCleanupProvider.vb b/src/Workspaces/VisualBasic/Portable/CodeCleanup/Providers/ReduceTokensCodeCleanupProvider.vb index 1fa009fe179bfaf0bc5c57b8216b73a089d21a8f..c5e33fe6181a06733141d432af7b7501aeef76ae 100644 --- a/src/Workspaces/VisualBasic/Portable/CodeCleanup/Providers/ReduceTokensCodeCleanupProvider.vb +++ b/src/Workspaces/VisualBasic/Portable/CodeCleanup/Providers/ReduceTokensCodeCleanupProvider.vb @@ -278,7 +278,7 @@ Namespace Microsoft.CodeAnalysis.CodeCleanup.Providers Dim asLong = CType(ConvertToULong(value), Long) Return "&B" + Convert.ToString(asLong, 2) Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(base) End Select End Function @@ -296,7 +296,7 @@ Namespace Microsoft.CodeAnalysis.CodeCleanup.Providers Case SyntaxKind.IntegerLiteralToken Return token.CopyAnnotationsTo(SyntaxFactory.IntegerLiteralToken(leading, newValueString, token.GetBase().Value, token.GetTypeCharacter(), DirectCast(newValue, ULong), trailing)) Case Else - Throw ExceptionUtilities.Unreachable + Throw ExceptionUtilities.UnexpectedValue(token.Kind) End Select End Function diff --git a/src/Workspaces/VisualBasic/Portable/CodeGeneration/ExpressionGenerator.StringPiece.vb b/src/Workspaces/VisualBasic/Portable/CodeGeneration/ExpressionGenerator.StringPiece.vb index b1012e6fc5430e09a8a5f8a13923ebb72277a3c3..901fa990304a21e30a65f6acf285d25527677657 100644 --- a/src/Workspaces/VisualBasic/Portable/CodeGeneration/ExpressionGenerator.StringPiece.vb +++ b/src/Workspaces/VisualBasic/Portable/CodeGeneration/ExpressionGenerator.StringPiece.vb @@ -68,9 +68,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration Return GenerateStringConstantExpression("vbTab") Case StringPieceKind.VerticalTab Return GenerateStringConstantExpression("vbVerticalTab") + Case Else + Throw ExceptionUtilities.UnexpectedValue(Me.Kind) End Select - - Throw ExceptionUtilities.Unreachable End Function Private Shared Function GenerateStringConstantExpression(name As String) As MemberAccessExpressionSyntax diff --git a/src/Workspaces/VisualBasic/Portable/Extensions/MethodBaseSyntaxExtensions.vb b/src/Workspaces/VisualBasic/Portable/Extensions/MethodBaseSyntaxExtensions.vb index ddae63e3e9ae2b7bd4c742bda3230ba6a52b2430..4859e134a60a6100fc38bbbc1b870f9a8c86f714 100644 --- a/src/Workspaces/VisualBasic/Portable/Extensions/MethodBaseSyntaxExtensions.vb +++ b/src/Workspaces/VisualBasic/Portable/Extensions/MethodBaseSyntaxExtensions.vb @@ -38,5 +38,4 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions Throw ExceptionUtilities.Unreachable End Function End Module - -End Namespace +End Namespace \ No newline at end of file diff --git a/src/Workspaces/VisualBasic/Portable/Extensions/TypeBlockSyntaxExtensions.vb b/src/Workspaces/VisualBasic/Portable/Extensions/TypeBlockSyntaxExtensions.vb index 537273775df03d21a9edba16941360c16f06ca6e..b158675f3010dcdf7c91e44a09e6bcc95812dc53 100644 --- a/src/Workspaces/VisualBasic/Portable/Extensions/TypeBlockSyntaxExtensions.vb +++ b/src/Workspaces/VisualBasic/Portable/Extensions/TypeBlockSyntaxExtensions.vb @@ -18,9 +18,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions Return DirectCast(node, StructureBlockSyntax).WithInherits(list) Case SyntaxKind.ClassBlock Return DirectCast(node, ClassBlockSyntax).WithInherits(list) + Case Else + Throw ExceptionUtilities.UnexpectedValue(node.Kind) End Select - - Throw ExceptionUtilities.Unreachable End Function @@ -34,9 +34,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions Return DirectCast(node, StructureBlockSyntax).WithImplements(list) Case SyntaxKind.ClassBlock Return DirectCast(node, ClassBlockSyntax).WithImplements(list) + Case Else + Throw ExceptionUtilities.UnexpectedValue(node.Kind) End Select - - Throw ExceptionUtilities.Unreachable End Function @@ -50,9 +50,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions Return DirectCast(node, StructureBlockSyntax).AddMembers(members) Case SyntaxKind.ClassBlock Return DirectCast(node, ClassBlockSyntax).AddMembers(members) + Case Else + Throw ExceptionUtilities.UnexpectedValue(node.Kind) End Select - - Throw ExceptionUtilities.Unreachable End Function @@ -66,9 +66,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions Return DirectCast(node, StructureBlockSyntax).WithMembers(members) Case SyntaxKind.ClassBlock Return DirectCast(node, ClassBlockSyntax).WithMembers(members) + Case Else + Throw ExceptionUtilities.UnexpectedValue(node.Kind) End Select - - Throw ExceptionUtilities.Unreachable End Function @@ -82,9 +82,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions Return DirectCast(node, StructureBlockSyntax).WithBlockStatement(DirectCast([begin], StructureStatementSyntax)) Case SyntaxKind.ClassBlock Return DirectCast(node, ClassBlockSyntax).WithBlockStatement(DirectCast([begin], ClassStatementSyntax)) + Case Else + Throw ExceptionUtilities.UnexpectedValue(node.Kind) End Select - - Throw ExceptionUtilities.Unreachable End Function @@ -98,9 +98,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions Return DirectCast(node, StructureBlockSyntax).WithEndBlockStatement([end]) Case SyntaxKind.ClassBlock Return DirectCast(node, ClassBlockSyntax).WithEndBlockStatement([end]) + Case Else + Throw ExceptionUtilities.UnexpectedValue(node.Kind) End Select - - Throw ExceptionUtilities.Unreachable End Function