Skip to content

Commit fcfb7b2

Browse files
committed
C#: Fix error caused by Roslyn upgrade.
1 parent e5aa7f3 commit fcfb7b2

File tree

1 file changed

+2
-9
lines changed
  • csharp/extractor/Semmle.Extraction.CSharp/Entities

1 file changed

+2
-9
lines changed

csharp/extractor/Semmle.Extraction.CSharp/Entities/Modifier.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,9 @@ public static void ExtractModifiers(Context cx, IEntity key, ISymbol symbol)
139139

140140
if (nt.TypeKind == TypeKind.Struct)
141141
{
142-
// Sadly, these properties are internal so cannot be accessed directly.
143-
// This seems to be a deficiency in the model.
144-
var readonlyProperty = nt.GetType().GetProperty("IsReadOnly", BindingFlags.NonPublic | BindingFlags.Instance);
145-
146-
bool isReadOnly = (bool)readonlyProperty.GetValue(nt);
147-
bool isByRefLikeType = nt.IsRefLikeType;
148-
149-
if (isReadOnly)
142+
if (nt.IsReadOnly)
150143
HasModifier(cx, key, "readonly");
151-
if (isByRefLikeType)
144+
if (nt.IsRefLikeType)
152145
HasModifier(cx, key, "ref");
153146
}
154147
}

0 commit comments

Comments
 (0)