Skip to content

Commit

Permalink
Merge pull request #455 from StefanMaron/development
Browse files Browse the repository at this point in the history
implement SkipFieldsNotMatchingType check on LC0044
  • Loading branch information
Arthurvdv authored Dec 19, 2023
2 parents 07de4e4 + 644f04f commit 4698ca9
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 4698ca9

Please sign in to comment.