mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
C#: Use covariant return for context overrides
This commit is contained in:
@@ -8,7 +8,7 @@ namespace Semmle.Extraction.CIL
|
||||
/// </summary>
|
||||
internal interface IGenericContext
|
||||
{
|
||||
Context Cx { get; }
|
||||
Context Context { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The list of generic type parameters/arguments, including type parameters/arguments of
|
||||
|
||||
@@ -10,8 +10,7 @@ namespace Semmle.Extraction.CIL
|
||||
/// </summary>
|
||||
internal abstract class LabelledEntity : Extraction.LabelledEntity, IExtractedEntity
|
||||
{
|
||||
// todo: with .NET 5 this can override the base context, and change the return type.
|
||||
public Context Cx => (Context)base.Context;
|
||||
public override Context Context => (Context)base.Context;
|
||||
|
||||
protected LabelledEntity(Context cx) : base(cx)
|
||||
{
|
||||
|
||||
@@ -9,8 +9,7 @@ namespace Semmle.Extraction.CIL
|
||||
/// </summary>
|
||||
internal abstract class UnlabelledEntity : Extraction.UnlabelledEntity, IExtractedEntity
|
||||
{
|
||||
// todo: with .NET 5 this can override the base context, and change the return type.
|
||||
public Context Cx => (Context)base.Context;
|
||||
public override Context Context => (Context)base.Context;
|
||||
|
||||
protected UnlabelledEntity(Context cx) : base(cx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user