We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60b7840 commit 82f5a02Copy full SHA for 82f5a02
csharp/extractor/Semmle.Extraction.CSharp.StubGenerator/StubVisitor.cs
@@ -306,7 +306,14 @@ public override void VisitField(IFieldSymbol symbol)
306
StubModifiers(symbol);
307
308
if (symbol.IsConst)
309
+ {
310
stubWriter.Write("const ");
311
+ }
312
+
313
+ if (!symbol.IsConst && symbol.IsReadOnly)
314
315
+ stubWriter.Write("readonly ");
316
317
318
if (IsUnsafe(symbol.Type))
319
{
@@ -317,7 +324,9 @@ public override void VisitField(IFieldSymbol symbol)
324
stubWriter.Write(" ");
325
stubWriter.Write(EscapeIdentifier(symbol.Name));
326
327
320
328
stubWriter.Write(" = default");
329
321
330
stubWriter.WriteLine(";");
322
331
}
323
332
0 commit comments