98 references to AddError
Microsoft.CodeAnalysis.CSharp (98)
Parser\DirectiveParser.cs (29)
38hash = this.AddError(hash, ErrorCode.ERR_BadDirectivePlacement); 125id = this.AddError(id, ErrorCode.ERR_PPDirectiveExpected); 129hash = this.AddError(hash, ErrorCode.ERR_PPDirectiveExpected); 166return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndRegionDirectiveExpected); 170return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndifDirectiveExpected); 174return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_UnexpectedDirective); 189return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndRegionDirectiveExpected); 193return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndifDirectiveExpected); 197return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_UnexpectedDirective); 212return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndRegionDirectiveExpected); 216return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_UnexpectedDirective); 234return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndifDirectiveExpected); 238return this.AddError(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_UnexpectedDirective); 246keyword = this.AddError(keyword, ErrorCode.ERR_PPDefFollowsToken); 384line = this.AddError(line, ErrorCode.ERR_InvalidLineNumber); 388line = this.AddError(line, ErrorCode.WRN_TooManyLinesForDebugger); 414start = this.AddError(start, ErrorCode.ERR_LineSpanDirectiveRequiresSpace); 424end = this.AddError(end, ErrorCode.ERR_LineSpanDirectiveEndLessThanStart); 433characterOffset = this.AddError(characterOffset, ErrorCode.ERR_LineSpanDirectiveRequiresSpace); 441file = this.AddError(file, ErrorCode.ERR_LineSpanDirectiveRequiresSpace); 486token = this.AddError(token, ErrorCode.ERR_LineSpanDirectiveInvalidValue); 499keyword = this.AddError(keyword, ErrorCode.ERR_ReferenceDirectiveOnlyAllowedInScripts); 503keyword = this.AddError(keyword, ErrorCode.ERR_PPReferenceFollowsToken); 519keyword = this.AddError(keyword, ErrorCode.ERR_LoadDirectiveOnlyAllowedInScripts); 523keyword = this.AddError(keyword, ErrorCode.ERR_PPLoadFollowsToken); 644guid = this.AddError(guid, ErrorCode.WRN_IllegalPPChecksum); 653bytes = this.AddError(bytes, ErrorCode.WRN_IllegalPPChecksum); 661bytes = this.AddError(bytes, ErrorCode.WRN_IllegalPPChecksum); 714skippedTokens.Add(this.AddError(this.EatToken().WithoutDiagnosticsGreen(), errorCode));
Parser\DocumentationCommentParser.cs (1)
1132var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked);
Parser\LanguageParser.cs (66)
254namespaceToken = this.AddError(namespaceToken, ErrorCode.ERR_NamespaceNotAllowedInScript); 459token = this.AddError(token, 566skippedToken = this.AddError(skippedToken, 616memberOrStatement = this.AddError(memberOrStatement, ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType); 661@using = this.AddError(@using, ErrorCode.ERR_UsingAfterElements); 1600this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 1854? this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected) 1864bounds.Add(_syntaxFactory.TypeConstraint(this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_TypeExpected))); 1885bounds.Add(_syntaxFactory.TypeConstraint(this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_TypeExpected))); 1962this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_NoEnumConstraint), 1971this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_NoDelegateConstraint), 2246this.AddError(SyntaxFactory.MissingToken(SyntaxKind.VoidKeyword), ErrorCode.ERR_MemberNeedsType)); 3319type = this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected); 3416separator = this.AddError(separator, ErrorCode.ERR_AliasQualAsExpression); 3449var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 3566opToken = this.AddError(opToken, ErrorCode.ERR_OvlOperatorExpected); 3611thisKeyword = this.AddError(thisKeyword, ErrorCode.ERR_UnexpectedGenericName); 3669identifier = this.AddError(identifier, ErrorCode.ERR_UnexpectedGenericName); 4025accessorName = this.AddError(accessorName, 4311identifier = this.AddError(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected); 4322this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4358this.AddError(SyntaxFactory.Token(exclamationEquals.GetLeadingTrivia(), SyntaxKind.ExclamationToken, "!", "!", trailing: null), ErrorCode.ERR_ParameterNullCheckingNotSupported)); 4367identifier = AddTrailingSkippedSyntax(identifier, this.AddError(this.EatToken(), ErrorCode.ERR_ParameterNullCheckingNotSupported)); 4564identifier = this.AddError(identifier, ErrorCode.ERR_IdentifierExpected); 4570identifier = this.AddError(identifier, ErrorCode.ERR_UnexpectedGenericName); 4606semi = this.AddError(semi, ErrorCode.ERR_UnexpectedSemicolon); 4675eventToken = this.AddError(eventToken, ErrorCode.ERR_ExplicitEventFieldImpl); // Better error message for confusing event situation. 4990name = this.AddError(name, ErrorCode.ERR_MultiTypeInDeclaration); 5040argumentList = this.AddError(argumentList, ErrorCode.ERR_BadVarDecl); 5053close = this.AddError(close, ErrorCode.ERR_ValueExpected); 5065expression = this.AddError(expression, ErrorCode.ERR_ArraySizeInDeclaration); 5079argumentList = this.AddError(argumentList, ErrorCode.ERR_CStyleArray); 5092name = this.AddError(name, ErrorCode.ERR_ConstValueRequired); // Error here for missing constant initializers 5099name = this.AddError(name, ErrorCode.ERR_FixedDimsRequired); 5219name = this.AddError(name, ErrorCode.ERR_UnexpectedGenericName); 5419identifierToken = this.AddError(identifierToken, ErrorCode.ERR_BadAwaitAsIdentifier); 5426return this.AddError(CreateMissingIdentifierToken(), code); 5509this.AddError(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected)); 5933? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 5974result = this.AddError(result, ErrorCode.ERR_TypeExpected); 6051separator = this.AddError(separator, ErrorCode.ERR_AliasQualAsExpression); 6105AddError(separator, ErrorCode.ERR_ExplicitEventFieldImpl)); 6170separator = this.AddError(separator, ErrorCode.ERR_UnexpectedAliasedName); 6240separator = this.AddError(separator, ErrorCode.ERR_AliasQualAsExpression); 6326separator = this.AddError(separator, ErrorCode.ERR_UnexpectedAliasedName); 6360var missingName = this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected); 7111var missing = this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_TupleTooFewElements); 7144token = this.AddError(token, mode == ParseTypeMode.Parameter ? ErrorCode.ERR_NoVoidParameter : ErrorCode.ERR_NoVoidHere); 7165return this.AddError( 7321unmanagedCallingConventions = AddError(unmanagedCallingConventions, ErrorCode.ERR_CannotSpecifyManagedWithUnmanagedSpecifiers); 8071? this.AddError( 8311semicolonToken = this.AddError(semicolonToken, ErrorCode.ERR_SemicolonExpected); 8748@in = this.AddError(@in, ErrorCode.ERR_BadForeachDecl); 9047returnOrBreak = this.AddError(returnOrBreak, ErrorCode.ERR_EmptyYield); 9125expression = this.AddError(expression, ErrorCode.ERR_SwitchGoverningExpressionRequiresParens); 9171node = this.AddError(node, ErrorCode.ERR_DiscardPatternInSwitchStatement); 9630type = this.AddError(type, ErrorCode.ERR_NoVoidHere); 9675mod = this.AddError(mod, ErrorCode.ERR_TypeExpected); 10584leftOperand = this.AddError(leftOperand, ErrorCode.ERR_ConditionalInInterpolation); 10775expr = this.AddError(expr, ErrorCode.ERR_ExpressionExpected); 10895this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 10926this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected)); 11533this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_TupleTooFewElements))); 12165var size = this.AddError(this.ParseExpressionCore(), ErrorCode.ERR_InvalidArray); 12239var size = this.AddError(this.ParseExpressionCore(), ErrorCode.ERR_InvalidStackAllocArray); 12245var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray);
Parser\LanguageParser_Patterns.cs (1)
569? AddError(this.EatToken(), ErrorCode.ERR_BadCaseInSwitchArm)
Parser\SyntaxParser.cs (1)
534token = AddError(token, code);