File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -534,6 +534,9 @@ private void StubParameters(ICollection<IParameterSymbol> parameters)
534
534
case RefKind . In :
535
535
stubWriter . Write ( "in " ) ;
536
536
break ;
537
+ case RefKind . RefReadOnlyParameter :
538
+ stubWriter . Write ( "ref readonly " ) ;
539
+ break ;
537
540
default :
538
541
stubWriter . Write ( $ "/* TODO: { parameter . RefKind } */") ;
539
542
break ;
@@ -884,4 +887,4 @@ public override void VisitProperty(IPropertySymbol symbol)
884
887
if ( explicitInterfaceImplementations . Length == 0 )
885
888
StubProperty ( symbol , null ) ;
886
889
}
887
- }
890
+ }
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public void StubGeneratorMethodTest()
42
42
// Setup
43
43
const string source = @"
44
44
public class MyTest {
45
- public int M1(string arg1) { return 0;}
45
+ public int M1(string arg1) { return 0; }
46
46
}" ;
47
47
48
48
// Execute
@@ -56,6 +56,26 @@ public class MyTest {
56
56
Assert . Equal ( expected , stub ) ;
57
57
}
58
58
59
+ [ Fact ]
60
+ public void StubGeneratorRefReadonlyParameterTest ( )
61
+ {
62
+ // Setup
63
+ const string source = @"
64
+ public class MyTest {
65
+ public int M1(ref readonly Guid guid) { return 0; }
66
+ }" ;
67
+
68
+ // Execute
69
+ var stub = GenerateStub ( source ) ;
70
+
71
+ // Verify
72
+ const string expected = @"public class MyTest {
73
+ public int M1(ref readonly Guid guid) => throw null;
74
+ }
75
+ " ;
76
+ Assert . Equal ( expected , stub ) ;
77
+ }
78
+
59
79
private static string GenerateStub ( string source )
60
80
{
61
81
var st = CSharpSyntaxTree . ParseText ( source ) ;
You can’t perform that action at this time.
0 commit comments