提交 04b333ce 编写于 作者: C CyrusNajmabadi

Pass along the value that was unexpected when we encounter one.

上级 7f38544a
......@@ -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
......
......@@ -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;
}
}
}
......@@ -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);
}
}
}
......
......@@ -553,7 +553,7 @@ private static RenameSpanKind GetRenameSpanKind(InlineRenameReplacementKind kind
return RenameSpanKind.Complexified;
default:
throw ExceptionUtilities.Unreachable;
throw ExceptionUtilities.UnexpectedValue(kind);
}
}
......
......@@ -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<ITextMarkerTag>(span, tagKind);
......
......@@ -161,7 +161,7 @@ private ImmutableArray<CompletionItem> GetFilesAndDirectories(string path, strin
break;
default:
throw ExceptionUtilities.Unreachable;
throw ExceptionUtilities.UnexpectedValue(pathKind);
}
return result.ToImmutableAndFree();
......
......@@ -69,7 +69,7 @@ public static string GetClassificationTypeName(string textTag)
return ClassificationTypeNames.Text;
default:
throw ExceptionUtilities.Unreachable;
throw ExceptionUtilities.UnexpectedValue(textTag);
}
}
}
......
......@@ -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
......@@ -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);
}
}
......
......@@ -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());
}
}
......
......@@ -740,7 +740,7 @@ private static void GetLambdaParts(SyntaxNode lambda, out IEnumerable<SyntaxToke
break;
default:
throw ExceptionUtilities.Unreachable;
throw ExceptionUtilities.UnexpectedValue(lambda.Kind());
}
}
......@@ -818,7 +818,7 @@ private bool TryComputeWeightedDistance(BlockSyntax leftBlock, BlockSyntax right
return true;
default:
throw ExceptionUtilities.Unreachable;
throw ExceptionUtilities.UnexpectedValue(leftBlock.Parent.Kind());
}
}
......
......@@ -48,7 +48,7 @@ private static bool CanBeSuppressedOrUnsuppressed(Diagnostic diagnostic, bool ch
return true;
default:
throw ExceptionUtilities.Unreachable;
throw ExceptionUtilities.UnexpectedValue(diagnostic.Severity);
}
}
......
......@@ -42,9 +42,9 @@ private string CreateDisplayText()
return string.Format(FeaturesResources.Rename_type_to_0, _state.DocumentName);
case OperationKind.RenameFile:
return string.Format(FeaturesResources.Rename_file_to_0, _fileName);
default:
throw ExceptionUtilities.UnexpectedValue(_operationKind);
}
throw ExceptionUtilities.Unreachable;
}
public override string Title => _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;
......
......@@ -139,7 +139,7 @@ public static string ToClassificationTypeName(this string taggedTextTag)
return ClassificationTypeNames.Text;
default:
throw ExceptionUtilities.Unreachable;
throw ExceptionUtilities.UnexpectedValue(taggedTextTag);
}
}
......
......@@ -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);
}
}
}
......
......@@ -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);
}
}
......
......@@ -147,7 +147,7 @@ protected bool TrySimplifyTypeNameExpression(SemanticModel model, SyntaxNode nod
break;
default:
throw ExceptionUtilities.Unreachable;
throw ExceptionUtilities.UnexpectedValue(diagnosticId);
}
if (descriptor == null)
......
......@@ -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));
......
......@@ -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);
}
}
......
......@@ -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;
......
......@@ -113,7 +113,7 @@ internal static PerLanguageOption<CodeStyleOption<bool>> GetApplicableOptionFrom
case SymbolKind.Event:
return CodeStyleOptions.QualifyEventAccess;
default:
throw ExceptionUtilities.Unreachable;
throw ExceptionUtilities.UnexpectedValue(symbolKind);
}
}
}
......
......@@ -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);
}
}
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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}",
......
......@@ -589,7 +589,7 @@ private static async Task<GraphNode> GetOrCreateNodeForNamedTypeAsync(Graph grap
break;
default:
throw ExceptionUtilities.Unreachable;
throw ExceptionUtilities.UnexpectedValue(namedType.TypeKind);
}
node[DgmlNodeProperties.Icon] = IconHelper.GetIconName(iconGroupName, namedType.DeclaredAccessibility);
......
......@@ -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
......
......@@ -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;
}
}
}
......@@ -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<bool> GetInsertionIndices(this TypeDeclarationSyntax destination, CancellationToken cancellationToken)
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
......@@ -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
......
......@@ -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
......
......@@ -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
......@@ -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
<Extension>
......@@ -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
<Extension>
......@@ -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
<Extension>
......@@ -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
<Extension>
......@@ -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
<Extension>
......@@ -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
<Extension>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册