Skip to content

Commit

Permalink
Bugfix for #178
Browse files Browse the repository at this point in the history
Systems fields do not need captions on pages
  • Loading branch information
StefanMaron committed Mar 20, 2022
1 parent 3cfd5ec commit 231f5a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Design/Rule0016CheckForMissingCaptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,12 @@ private bool CaptionIsMissing(ISymbol Symbol, SymbolAnalysisContext context)
try
{
if (Symbol.ContainingType.Kind == SymbolKind.Table)
{
if (((ITableTypeSymbol)Symbol.ContainingType).Id >= 2000000000)
return false;
if (((IFieldSymbol)Symbol).Id >= 2000000000)
return false;
}
}
catch (NullReferenceException)
{ }
Expand Down
7 changes: 6 additions & 1 deletion Design/Rule0017WriteToFlowField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,19 @@ private void CheckForWriteToFlowField(OperationAnalysisContext context)
else
{
IAssignmentStatement operation = (IAssignmentStatement)context.Operation;
if (operation.Target.Kind == OperationKind.FieldAccess && ((ITextIndexAccess)operation.Target).TextExpression.Kind == OperationKind.FieldAccess)
if (operation.Target.Kind == OperationKind.FieldAccess)
{
try
{
var FieldClass = FieldClassKind.Normal;

if (operation.Target.Syntax.Kind == SyntaxKind.ArrayIndexExpression)
{
if (((ITextIndexAccess)operation.Target).TextExpression.Kind != OperationKind.FieldAccess)
return;

FieldClass = ((IFieldAccess)((ITextIndexAccess)operation.Target).TextExpression).FieldSymbol.FieldClass;
}
else
FieldClass = ((IFieldAccess)operation.Target).FieldSymbol.FieldClass;

Expand Down

0 comments on commit 231f5a0

Please sign in to comment.