Skip to content

Commit c6b4764

Browse files
committed
Move the nullable disable warning region to the Type instead of the base CachedSymbol entity
1 parent df9d54c commit c6b4764

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ namespace Semmle.Extraction.CSharp.Entities
1111
{
1212
internal abstract class CachedSymbol<T> : CachedEntity<T> where T : class, ISymbol
1313
{
14-
#nullable disable warnings
15-
protected CachedSymbol(Context cx, T? init)
14+
protected CachedSymbol(Context cx, T init)
1615
: base(cx, init)
1716
{
1817
}
19-
#nullable restore warnings
2018

2119
public virtual Type? ContainingType => Symbol.ContainingType != null ? Type.Create(Context, Symbol.ContainingType) : null;
2220

csharp/extractor/Semmle.Extraction.CSharp/Entities/Types/Type.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ namespace Semmle.Extraction.CSharp.Entities
1010
{
1111
internal abstract class Type : CachedSymbol<ITypeSymbol>
1212
{
13+
#nullable disable warnings
1314
protected Type(Context cx, ITypeSymbol? init)
1415
: base(cx, init) { }
15-
16+
#nullable restore warnings
1617

1718
public override bool NeedsPopulation =>
1819
base.NeedsPopulation || Symbol.TypeKind == TypeKind.Dynamic || Symbol.TypeKind == TypeKind.TypeParameter;

0 commit comments

Comments
 (0)