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