diff --git a/.github/workflows/csv-coverage-pr-artifacts.yml b/.github/workflows/csv-coverage-pr-artifacts.yml index 8e2df456260f..d9e0ccba5f29 100644 --- a/.github/workflows/csv-coverage-pr-artifacts.yml +++ b/.github/workflows/csv-coverage-pr-artifacts.yml @@ -44,7 +44,7 @@ jobs: git log -1 --format='%H' working-directory: base - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Download CodeQL CLI diff --git a/.github/workflows/csv-coverage-pr-comment.yml b/.github/workflows/csv-coverage-pr-comment.yml index 86fe74d3419a..56904f261ba6 100644 --- a/.github/workflows/csv-coverage-pr-comment.yml +++ b/.github/workflows/csv-coverage-pr-comment.yml @@ -22,7 +22,7 @@ jobs: - name: Clone self (github/codeql) uses: actions/checkout@v4 - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 diff --git a/.github/workflows/csv-coverage-timeseries.yml b/.github/workflows/csv-coverage-timeseries.yml index cf2758dd9d34..2d7ef19465cd 100644 --- a/.github/workflows/csv-coverage-timeseries.yml +++ b/.github/workflows/csv-coverage-timeseries.yml @@ -18,7 +18,7 @@ jobs: path: codeqlModels fetch-depth: 0 - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Download CodeQL CLI diff --git a/.github/workflows/csv-coverage-update.yml b/.github/workflows/csv-coverage-update.yml index ccf1ffd47053..b1a6ccd32ee3 100644 --- a/.github/workflows/csv-coverage-update.yml +++ b/.github/workflows/csv-coverage-update.yml @@ -22,7 +22,7 @@ jobs: path: ql fetch-depth: 0 - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Download CodeQL CLI diff --git a/.github/workflows/csv-coverage.yml b/.github/workflows/csv-coverage.yml index 4fb1d143fc39..1498d5e699b3 100644 --- a/.github/workflows/csv-coverage.yml +++ b/.github/workflows/csv-coverage.yml @@ -22,7 +22,7 @@ jobs: path: codeqlModels ref: ${{ github.event.inputs.qlModelShaOverride || github.ref }} - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Download CodeQL CLI diff --git a/.github/workflows/query-list.yml b/.github/workflows/query-list.yml index 07fb3b682da3..3a25fc90af0f 100644 --- a/.github/workflows/query-list.yml +++ b/.github/workflows/query-list.yml @@ -24,7 +24,7 @@ jobs: with: path: codeql - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Download CodeQL CLI diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 8a04d4741181..c6cc23a1610b 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -79,7 +79,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: bazelbuild/setup-bazelisk@v2 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version-file: 'swift/.python-version' - uses: pre-commit/action@v3.0.0 diff --git a/csharp/extractor/Semmle.Extraction.CSharp.StubGenerator/StubVisitor.cs b/csharp/extractor/Semmle.Extraction.CSharp.StubGenerator/StubVisitor.cs index 57a1c823fc12..983175f4c17a 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.StubGenerator/StubVisitor.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.StubGenerator/StubVisitor.cs @@ -534,6 +534,9 @@ private void StubParameters(ICollection parameters) case RefKind.In: stubWriter.Write("in "); break; + case RefKind.RefReadOnlyParameter: + stubWriter.Write("ref readonly "); + break; default: stubWriter.Write($"/* TODO: {parameter.RefKind} */"); break; @@ -884,4 +887,4 @@ public override void VisitProperty(IPropertySymbol symbol) if (explicitInterfaceImplementations.Length == 0) StubProperty(symbol, null); } -} \ No newline at end of file +} diff --git a/csharp/extractor/Semmle.Extraction.Tests/StubGenerator.cs b/csharp/extractor/Semmle.Extraction.Tests/StubGenerator.cs index 598ff77ca25b..ea60c60bad61 100644 --- a/csharp/extractor/Semmle.Extraction.Tests/StubGenerator.cs +++ b/csharp/extractor/Semmle.Extraction.Tests/StubGenerator.cs @@ -42,7 +42,7 @@ public void StubGeneratorMethodTest() // Setup const string source = @" public class MyTest { - public int M1(string arg1) { return 0;} + public int M1(string arg1) { return 0; } }"; // Execute @@ -56,6 +56,26 @@ public class MyTest { Assert.Equal(expected, stub); } + [Fact] + public void StubGeneratorRefReadonlyParameterTest() + { + // Setup + const string source = @" +public class MyTest { + public int M1(ref readonly Guid guid) { return 0; } +}"; + + // Execute + var stub = GenerateStub(source); + + // Verify + const string expected = @"public class MyTest { +public int M1(ref readonly Guid guid) => throw null; +} +"; + Assert.Equal(expected, stub); + } + private static string GenerateStub(string source) { var st = CSharpSyntaxTree.ParseText(source);