diff --git a/.github/workflows/go-tests-other-os.yml b/.github/workflows/go-tests-other-os.yml index 09765011a18f..8b0395fad906 100644 --- a/.github/workflows/go-tests-other-os.yml +++ b/.github/workflows/go-tests-other-os.yml @@ -15,7 +15,7 @@ jobs: runs-on: macos-latest steps: - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} id: go @@ -50,7 +50,7 @@ jobs: runs-on: windows-latest-xl steps: - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} id: go diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 7885f504bba3..9d518ac70b65 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest-xl steps: - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} id: go 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);