Merge pull request #1361 from calumgrant/cs/roslyn-3.1

C#: Update to Roslyn 3.1
This commit is contained in:
Tom Hvitved
2019-05-22 20:31:09 +02:00
committed by GitHub
3 changed files with 4 additions and 11 deletions

View File

@@ -139,16 +139,9 @@ namespace Semmle.Extraction.CSharp.Entities
if (nt.TypeKind == TypeKind.Struct)
{
// Sadly, these properties are internal so cannot be accessed directly.
// This seems to be a deficiency in the model.
var readonlyProperty = nt.GetType().GetProperty("IsReadOnly", BindingFlags.NonPublic | BindingFlags.Instance);
bool isReadOnly = (bool)readonlyProperty.GetValue(nt);
bool isByRefLikeType = nt.IsRefLikeType;
if (isReadOnly)
if (nt.IsReadOnly)
HasModifier(cx, key, "readonly");
if (isByRefLikeType)
if (nt.IsRefLikeType)
HasModifier(cx, key, "ref");
}
}

View File

@@ -19,7 +19,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.1.0" />
</ItemGroup>
</Project>

View File

@@ -12,7 +12,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="3.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="3.1.0" />
<PackageReference Include="GitInfo" Version="2.0.18" />
</ItemGroup>