From eb64fcd208039d92c1ffc3de463a7faa940534bc Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 20 Mar 2026 11:16:43 +0100 Subject: [PATCH] C#: Add test that shows unintended flow summary generation --- .../dataflow/CaptureContentSummaryModels.expected | 1 + csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureContentSummaryModels.expected b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureContentSummaryModels.expected index cb6fc390349..47769d299c3 100644 --- a/csharp/ql/test/utils/modelgenerator/dataflow/CaptureContentSummaryModels.expected +++ b/csharp/ql/test/utils/modelgenerator/dataflow/CaptureContentSummaryModels.expected @@ -1,2 +1,3 @@ unexpectedModel +| Unexpected contentbased-summary found: Models;HigherOrderParameters;false;Apply;(System.Func,System.Object);;Argument[1];ReturnValue;value;dfc-generated | expectedModel diff --git a/csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs b/csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs index b59513504d9..4c85b397ac1 100644 --- a/csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs +++ b/csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs @@ -536,6 +536,12 @@ public class HigherOrderParameters { a(o); } + + private void CallApply() + { + // Test that this call to `Apply` does not interfere with the flow summaries generated for `Apply` + Apply(x => x, null); + } } public static class HigherOrderExtensionMethods