102 references to AddError
Microsoft.CodeAnalysis.CSharp (102)
Parser\DirectiveParser.cs (33)
116hash = this.AddError(hash, ErrorCode.ERR_BadDirectivePlacement); 131id = this.AddError(id, ErrorCode.ERR_PPDirectiveExpected); 135hash = this.AddError(hash, ErrorCode.ERR_PPDirectiveExpected); 171return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndRegionDirectiveExpected); 175return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndifDirectiveExpected); 179return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_UnexpectedDirective); 194return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndRegionDirectiveExpected); 198return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndifDirectiveExpected); 202return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_UnexpectedDirective); 217return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndRegionDirectiveExpected); 221return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_UnexpectedDirective); 239return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndifDirectiveExpected); 243return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_UnexpectedDirective); 251keyword = this.AddError(keyword, ErrorCode.ERR_PPDefFollowsToken); 389line = this.AddError(line, ErrorCode.ERR_InvalidLineNumber); 393line = this.AddError(line, ErrorCode.WRN_TooManyLinesForDebugger); 419start = this.AddError(start, ErrorCode.ERR_LineSpanDirectiveRequiresSpace); 429end = this.AddError(end, ErrorCode.ERR_LineSpanDirectiveEndLessThanStart); 438characterOffset = this.AddError(characterOffset, ErrorCode.ERR_LineSpanDirectiveRequiresSpace); 446file = this.AddError(file, ErrorCode.ERR_LineSpanDirectiveRequiresSpace); 491token = this.AddError(token, ErrorCode.ERR_LineSpanDirectiveInvalidValue); 504keyword = this.AddError(keyword, ErrorCode.ERR_ReferenceDirectiveOnlyAllowedInScripts); 508keyword = this.AddError(keyword, ErrorCode.ERR_PPReferenceFollowsToken); 524keyword = this.AddError(keyword, ErrorCode.ERR_LoadDirectiveOnlyAllowedInScripts); 528keyword = this.AddError(keyword, ErrorCode.ERR_PPLoadFollowsToken); 649guid = this.AddError(guid, ErrorCode.WRN_IllegalPPChecksum); 658bytes = this.AddError(bytes, ErrorCode.WRN_IllegalPPChecksum); 666bytes = this.AddError(bytes, ErrorCode.WRN_IllegalPPChecksum); 690exclamation = this.AddError(exclamation, ErrorCode.ERR_PPShebangInProjectBasedProgram); 702colon = this.AddError(colon, ErrorCode.ERR_PPIgnoredNeedsFileBasedProgram); 707colon = this.AddError(colon, ErrorCode.ERR_PPIgnoredFollowsToken); 712colon = this.AddError(colon, ErrorCode.ERR_PPIgnoredFollowsIf); 745skippedTokens.Add(this.AddError(this.EatToken().WithoutDiagnosticsGreen(), errorCode));
Parser\LanguageParser.cs (67)
256namespaceToken = this.AddError(namespaceToken, ErrorCode.ERR_NamespaceNotAllowedInScript); 527: AddError( 616token = this.AddError(token, 733skippedToken = this.AddError(skippedToken, 783memberOrStatement = this.AddError(memberOrStatement, ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType); 828@using = this.AddError(@using, ErrorCode.ERR_UsingAfterElements); 971unsafeToken = AddTrailingSkippedSyntax(unsafeToken, AddError(this.EatToken(), ErrorCode.ERR_BadStaticAfterUnsafe)); 1745keyword = AddTrailingSkippedSyntax(keyword, this.AddError(this.EatToken(), ErrorCode.ERR_ExtensionDisallowsName)); 1887this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 2178? this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected) 2188bounds.Add(_syntaxFactory.TypeConstraint(this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_TypeExpected))); 2220bounds.Add(_syntaxFactory.TypeConstraint(this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_TypeExpected))); 2299this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_NoEnumConstraint), 2308this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_NoDelegateConstraint), 2620this.AddError(SyntaxFactory.MissingToken(SyntaxKind.VoidKeyword), ErrorCode.ERR_MemberNeedsType)); 3704type = this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected); 3801separator = this.AddError(separator, ErrorCode.ERR_AliasQualAsExpression); 3834var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 4010opToken = this.AddError(opToken, ErrorCode.ERR_OvlOperatorExpected); 4056thisKeyword = this.AddError(thisKeyword, ErrorCode.ERR_UnexpectedGenericName); 4114identifier = this.AddError(identifier, ErrorCode.ERR_UnexpectedGenericName); 4500accessorName = this.AddError(accessorName, 4800identifier = allowOptionalIdentifier ? null : this.AddError(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected); 4814this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4970identifier = this.AddError(identifier, ErrorCode.ERR_IdentifierExpected); 4976identifier = this.AddError(identifier, ErrorCode.ERR_UnexpectedGenericName); 5012semi = this.AddError(semi, ErrorCode.ERR_UnexpectedSemicolon); 5065eventToken = this.AddError(eventToken, ErrorCode.ERR_ExplicitEventFieldImpl); 5414name = this.AddError(name, ErrorCode.ERR_MultiTypeInDeclaration); 5464argumentList = this.AddError(argumentList, ErrorCode.ERR_BadVarDecl); 5477close = this.AddError(close, ErrorCode.ERR_ValueExpected); 5489expression = this.AddError(expression, ErrorCode.ERR_ArraySizeInDeclaration); 5503argumentList = this.AddError(argumentList, ErrorCode.ERR_CStyleArray); 5516name = this.AddError(name, ErrorCode.ERR_ConstValueRequired); // Error here for missing constant initializers 5523name = this.AddError(name, ErrorCode.ERR_FixedDimsRequired); 5642name = this.AddError(name, ErrorCode.ERR_UnexpectedGenericName); 5842identifierToken = this.AddError(identifierToken, ErrorCode.ERR_BadAwaitAsIdentifier); 5849return this.AddError(CreateMissingIdentifierToken(), code); 5939this.AddError(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected)); 6477? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6518result = this.AddError(result, ErrorCode.ERR_TypeExpected); 6595separator = this.AddError(separator, ErrorCode.ERR_AliasQualAsExpression); 6649AddError(separator, ErrorCode.ERR_ExplicitEventFieldImpl)); 6705separator = this.AddError(separator, ErrorCode.ERR_UnexpectedAliasedName); 6769separator = this.AddError(separator, ErrorCode.ERR_AliasQualAsExpression); 6847separator = this.AddError(separator, ErrorCode.ERR_UnexpectedAliasedName); 7729var missing = this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_TupleTooFewElements); 7762token = this.AddError(token, mode == ParseTypeMode.Parameter ? ErrorCode.ERR_NoVoidParameter : ErrorCode.ERR_NoVoidHere); 7783return this.AddError( 7939unmanagedCallingConventions = AddError(unmanagedCallingConventions, ErrorCode.ERR_CannotSpecifyManagedWithUnmanagedSpecifiers); 8791? this.AddError( 9041semicolonToken = this.AddError(semicolonToken, ErrorCode.ERR_SemicolonExpected); 9478@in = this.AddError(@in, ErrorCode.ERR_BadForeachDecl); 9828returnOrBreak = this.AddError(returnOrBreak, ErrorCode.ERR_EmptyYield); 9906expression = this.AddError(expression, ErrorCode.ERR_SwitchGoverningExpressionRequiresParens); 9952node = this.AddError(node, ErrorCode.ERR_DiscardPatternInSwitchStatement); 10465type = this.AddError(type, ErrorCode.ERR_NoVoidHere); 10506mod = this.AddError(mod, ErrorCode.ERR_NoModifiersOnUsing); 10515mod = this.AddError(mod, ErrorCode.ERR_TypeExpected); 11373return this.AddError(conditionalExpression, ErrorCode.ERR_ConditionalInInterpolation); 11779expr = this.AddError(expr, ErrorCode.ERR_ExpressionExpected); 11823this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 11854this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected)); 12561this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_TupleTooFewElements))); 13248var size = this.AddError(this.ParseExpressionCore(), ErrorCode.ERR_InvalidArray); 13322var size = this.AddError(this.ParseExpressionCore(), ErrorCode.ERR_InvalidStackAllocArray); 13328var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray);
Parser\LanguageParser_Patterns.cs (1)
591? AddError(this.EatToken(), ErrorCode.ERR_BadCaseInSwitchArm)
Parser\SyntaxParser.cs (1)
570token = AddError(token, code);