diff --git a/Design/Rule0044AnalyzeTransferField.cs b/Design/Rule0044AnalyzeTransferField.cs index 4ec1373b..615a0433 100644 --- a/Design/Rule0044AnalyzeTransferField.cs +++ b/Design/Rule0044AnalyzeTransferField.cs @@ -58,10 +58,6 @@ 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? records = GetInvokingRecordNames(invocationExpression); @@ -243,6 +239,8 @@ private void ReportFieldDiagnostics(SyntaxNodeAnalysisContext ctx, Table table, if (invocationExpression.ArgumentList.Arguments.Count < 1) return null; + if (invocationExpression.ArgumentList.Arguments.Count == 3 && invocationExpression.ArgumentList.Arguments[2].GetIdentifierOrLiteralValue() == "true") return null; + if (invocationExpression.Expression.GetType() == typeof(MemberAccessExpressionSyntax)) { MemberAccessExpressionSyntax memberAccessExpression = (MemberAccessExpressionSyntax)invocationExpression.Expression;