106 references to AddError
Microsoft.CodeAnalysis.CSharp (106)
Parser\DirectiveParser.cs (33)
116hash = this.AddError(hash, ErrorCode.ERR_PPShebangNotOnFirstLine); 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); 390line = this.AddError(line, ErrorCode.ERR_InvalidLineNumber); 394line = this.AddError(line, ErrorCode.WRN_TooManyLinesForDebugger); 420start = this.AddError(start, ErrorCode.ERR_LineSpanDirectiveRequiresSpace); 430end = this.AddError(end, ErrorCode.ERR_LineSpanDirectiveEndLessThanStart); 439characterOffset = this.AddError(characterOffset, ErrorCode.ERR_LineSpanDirectiveRequiresSpace); 447file = this.AddError(file, ErrorCode.ERR_LineSpanDirectiveRequiresSpace); 492token = this.AddError(token, ErrorCode.ERR_LineSpanDirectiveInvalidValue); 505keyword = this.AddError(keyword, ErrorCode.ERR_ReferenceDirectiveOnlyAllowedInScripts); 509keyword = this.AddError(keyword, ErrorCode.ERR_PPReferenceFollowsToken); 525keyword = this.AddError(keyword, ErrorCode.ERR_LoadDirectiveOnlyAllowedInScripts); 529keyword = this.AddError(keyword, ErrorCode.ERR_PPLoadFollowsToken); 650guid = this.AddError(guid, ErrorCode.WRN_IllegalPPChecksum); 659bytes = this.AddError(bytes, ErrorCode.WRN_IllegalPPChecksum); 667bytes = this.AddError(bytes, ErrorCode.WRN_IllegalPPChecksum); 691exclamation = this.AddError(exclamation, ErrorCode.ERR_PPShebangInProjectBasedProgram); 703colon = this.AddError(colon, ErrorCode.ERR_PPIgnoredNeedsFileBasedProgram); 708colon = this.AddError(colon, ErrorCode.ERR_PPIgnoredFollowsToken); 713colon = this.AddError(colon, ErrorCode.ERR_PPIgnoredFollowsIf); 746skippedTokens.Add(this.AddError(this.EatToken().WithoutDiagnosticsGreen(), errorCode));
Parser\LanguageParser.cs (68)
256namespaceToken = this.AddError(namespaceToken, ErrorCode.ERR_NamespaceNotAllowedInScript); 527: AddError( 616token = this.AddError(token, 706this.AddError(attribute.Target.Identifier, ErrorCode.ERR_GlobalAttributesNotFirst), 741skippedToken = this.AddError(skippedToken, 791memberOrStatement = this.AddError(memberOrStatement, ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType); 837@using = this.AddError(@using, ErrorCode.ERR_UsingAfterElements); 980unsafeToken = AddTrailingSkippedSyntax(unsafeToken, AddError(this.EatToken(), ErrorCode.ERR_BadStaticAfterUnsafe)); 1811keyword = AddTrailingSkippedSyntax(keyword, this.AddError(this.EatToken(), ErrorCode.ERR_ExtensionDisallowsName)); 1947this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 2254? this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected) 2264bounds.Add(_syntaxFactory.TypeConstraint(this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_TypeExpected))); 2296bounds.Add(_syntaxFactory.TypeConstraint(this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_TypeExpected))); 2375this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_NoEnumConstraint), 2384this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_NoDelegateConstraint), 2706this.AddError(SyntaxFactory.MissingToken(SyntaxKind.VoidKeyword), ErrorCode.ERR_MemberNeedsType)); 3209identifierOrThisOpt ??= this.AddError(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected); 3879type = this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected); 3976separator = this.AddError(separator, ErrorCode.ERR_AliasQualAsExpression); 4009var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 4185opToken = this.AddError(opToken, ErrorCode.ERR_OvlOperatorExpected); 4231thisKeyword = this.AddError(thisKeyword, ErrorCode.ERR_UnexpectedGenericName); 4289identifier = this.AddError(identifier, ErrorCode.ERR_UnexpectedGenericName); 4704accessorName = this.AddError(accessorName, 5005identifier = identifierIsOptional ? null : this.AddError(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected); 5019this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 5193identifier = this.AddError(identifier, ErrorCode.ERR_IdentifierExpected); 5199identifier = this.AddError(identifier, ErrorCode.ERR_UnexpectedGenericName); 5235semi = this.AddError(semi, ErrorCode.ERR_UnexpectedSemicolon); 5288eventToken = this.AddError(eventToken, ErrorCode.ERR_ExplicitEventFieldImpl); 5638name = this.AddError(name, ErrorCode.ERR_MultiTypeInDeclaration); 5688argumentList = this.AddError(argumentList, ErrorCode.ERR_BadVarDecl); 5701close = this.AddError(close, ErrorCode.ERR_ValueExpected); 5713expression = this.AddError(expression, ErrorCode.ERR_ArraySizeInDeclaration); 5727argumentList = this.AddError(argumentList, ErrorCode.ERR_CStyleArray); 5760name = this.AddError(name, ErrorCode.ERR_ConstValueRequired); // Error here for missing constant initializers 5767name = this.AddError(name, ErrorCode.ERR_FixedDimsRequired); 5927name = this.AddError(name, ErrorCode.ERR_UnexpectedGenericName); 6127identifierToken = this.AddError(identifierToken, ErrorCode.ERR_BadAwaitAsIdentifier); 6134return this.AddError(CreateMissingIdentifierToken(), code); 6231this.AddError(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected)); 6760? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6801result = this.AddError(result, ErrorCode.ERR_TypeExpected); 6878separator = this.AddError(separator, ErrorCode.ERR_AliasQualAsExpression); 6932AddError(separator, ErrorCode.ERR_ExplicitEventFieldImpl)); 6988separator = this.AddError(separator, ErrorCode.ERR_UnexpectedAliasedName); 7052separator = this.AddError(separator, ErrorCode.ERR_AliasQualAsExpression); 7130separator = this.AddError(separator, ErrorCode.ERR_UnexpectedAliasedName); 8008var missing = this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_TupleTooFewElements); 8041token = this.AddError(token, mode == ParseTypeMode.Parameter ? ErrorCode.ERR_NoVoidParameter : ErrorCode.ERR_NoVoidHere); 8062return this.AddError( 8218unmanagedCallingConventions = AddError(unmanagedCallingConventions, ErrorCode.ERR_CannotSpecifyManagedWithUnmanagedSpecifiers); 9135? this.AddError( 9385semicolonToken = this.AddError(semicolonToken, ErrorCode.ERR_SemicolonExpected); 9824@in = this.AddError(@in, ErrorCode.ERR_BadForeachDecl); 10207returnOrBreak = this.AddError(returnOrBreak, ErrorCode.ERR_EmptyYield); 10285expression = this.AddError(expression, ErrorCode.ERR_SwitchGoverningExpressionRequiresParens); 10331node = this.AddError(node, ErrorCode.ERR_DiscardPatternInSwitchStatement); 10846type = this.AddError(type, ErrorCode.ERR_NoVoidHere); 10887mod = this.AddError(mod, ErrorCode.ERR_NoModifiersOnUsing); 11756return this.AddError(conditionalExpression, ErrorCode.ERR_ConditionalInInterpolation); 12165expr = this.AddError(expr, ErrorCode.ERR_ExpressionExpected); 12224this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 12255this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected)); 12971this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_TupleTooFewElements))); 13692var size = this.AddError(this.ParseExpressionCore(), ErrorCode.ERR_InvalidArray); 13766var size = this.AddError(this.ParseExpressionCore(), ErrorCode.ERR_InvalidStackAllocArray); 13772var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray);
Parser\LanguageParser_Patterns.cs (4)
169skippedSyntax: AddError(this.EatToken(), ErrorCode.ERR_EqualityOperatorInPatternNotSupported), 178this.AddError(this.EatToken(), ErrorCode.ERR_InequalityOperatorInPatternNotSupported)), 380? AddError(this.EatToken(), ErrorCode.ERR_DesignatorBeforePropertyPattern) 616? AddError(this.EatToken(), ErrorCode.ERR_BadCaseInSwitchArm)
Parser\SyntaxParser.cs (1)
564token = AddError(token, code);