зеркало из https://github.com/github/codeql.git
C#: Change constructor visibility to protected in abstract classes
This commit is contained in:
Родитель
71faa51270
Коммит
397be7e98f
|
@ -146,7 +146,7 @@ namespace Semmle.Autobuild.Shared
|
|||
/// solution file and tools.
|
||||
/// </summary>
|
||||
/// <param name="options">The command line options.</param>
|
||||
public Autobuilder(IBuildActions actions, AutobuildOptions options)
|
||||
protected Autobuilder(IBuildActions actions, AutobuildOptions options)
|
||||
{
|
||||
Actions = actions;
|
||||
Options = options;
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace Semmle.Extraction.CIL.Driver
|
|||
|
||||
var options = new ExtractorOptions(args);
|
||||
var layout = new Layout();
|
||||
var logger = new ConsoleLogger(options.Verbosity);
|
||||
using var logger = new ConsoleLogger(options.Verbosity);
|
||||
|
||||
var actions = options.
|
||||
AssembliesToExtract.Select(asm => asm.filename).
|
||||
|
|
|
@ -125,7 +125,7 @@ namespace Semmle.Extraction.CIL
|
|||
{
|
||||
public Context cx;
|
||||
|
||||
public GenericContext(Context cx)
|
||||
protected GenericContext(Context cx)
|
||||
{
|
||||
this.cx = cx;
|
||||
}
|
||||
|
|
|
@ -963,7 +963,7 @@ namespace Semmle.Extraction.CIL.Entities
|
|||
{
|
||||
protected readonly GenericContext gc;
|
||||
|
||||
public TypeParameter(GenericContext gc) : base(gc.cx)
|
||||
protected TypeParameter(GenericContext gc) : base(gc.cx)
|
||||
{
|
||||
this.gc = gc;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
|||
{
|
||||
public abstract class Method : CachedSymbol<IMethodSymbol>, IExpressionParentEntity, IStatementParentEntity
|
||||
{
|
||||
public Method(Context cx, IMethodSymbol init)
|
||||
protected Method(Context cx, IMethodSymbol init)
|
||||
: base(cx, init) { }
|
||||
|
||||
protected void PopulateParameters()
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
|||
{
|
||||
public abstract class CachedSymbol<T> : CachedEntity<T> where T : ISymbol
|
||||
{
|
||||
public CachedSymbol(Context cx, T init)
|
||||
protected CachedSymbol(Context cx, T init)
|
||||
: base(cx, init) { }
|
||||
|
||||
public virtual Type ContainingType => symbol.ContainingType != null ? Type.Create(Context, symbol.ContainingType) : null;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
|||
|
||||
public abstract class Type : CachedSymbol<ITypeSymbol>
|
||||
{
|
||||
public Type(Context cx, ITypeSymbol init)
|
||||
protected Type(Context cx, ITypeSymbol init)
|
||||
: base(cx, init) { }
|
||||
|
||||
public virtual AnnotatedType ElementType => default(AnnotatedType);
|
||||
|
@ -336,7 +336,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
|||
|
||||
abstract class Type<T> : Type where T : ITypeSymbol
|
||||
{
|
||||
public Type(Context cx, T init)
|
||||
protected Type(Context cx, T init)
|
||||
: base(cx, init) { }
|
||||
|
||||
public new T symbol => (T)base.symbol;
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Semmle.Extraction.Entities
|
|||
{
|
||||
public abstract class Location : CachedEntity<Microsoft.CodeAnalysis.Location?>
|
||||
{
|
||||
public Location(Context cx, Microsoft.CodeAnalysis.Location? init)
|
||||
protected Location(Context cx, Microsoft.CodeAnalysis.Location? init)
|
||||
: base(cx, init) { }
|
||||
|
||||
public static Location Create(Context cx, Microsoft.CodeAnalysis.Location? loc) =>
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Semmle.Extraction
|
|||
{
|
||||
protected readonly Context cx;
|
||||
|
||||
public FreshEntity(Context cx)
|
||||
protected FreshEntity(Context cx)
|
||||
{
|
||||
this.cx = cx;
|
||||
cx.AddFreshLabel(this);
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Semmle.Extraction
|
|||
/// <typeparam name="Initializer">The type of the symbol.</typeparam>
|
||||
public abstract class CachedEntity<Initializer> : ICachedEntity
|
||||
{
|
||||
public CachedEntity(Context context, Initializer init)
|
||||
protected CachedEntity(Context context, Initializer init)
|
||||
{
|
||||
Context = context;
|
||||
symbol = init;
|
||||
|
|
Загрузка…
Ссылка в новой задаче