Skip to content

Commit

Permalink
implement SkipFieldsNotMatchingType check
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthurvdv committed Dec 19, 2023
1 parent 85f80fc commit 644f04f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Design/Rule0044AnalyzeTransferField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ private async void AnalyzeTransferFields(OperationAnalysisContext ctx)
if (ctx.Operation.Syntax.GetType() != typeof(InvocationExpressionSyntax))
return;

IArgument? skipFieldsNotMatchingTypeParam = ((IInvocationExpression)ctx.Operation).Arguments.Where(args => SemanticFacts.IsSameName(args.Parameter.Name, "SkipFieldsNotMatchingType")).SingleOrDefault() as IArgument;
if (skipFieldsNotMatchingTypeParam != null)
if (skipFieldsNotMatchingTypeParam.Value.ConstantValue.HasValue && (bool)skipFieldsNotMatchingTypeParam.Value.ConstantValue.Value) return;

InvocationExpressionSyntax invocationExpression = (InvocationExpressionSyntax)ctx.Operation.Syntax;

Tuple<string, string>? records = GetInvokingRecordNames(invocationExpression);
Expand Down

0 comments on commit 644f04f

Please sign in to comment.