Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seal types not suitable for extending #611

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Fluid/Accessors/AsyncDelegateAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Fluid.Accessors
{
public class AsyncDelegateAccessor : AsyncDelegateAccessor<object, object>
public sealed class AsyncDelegateAccessor : AsyncDelegateAccessor<object, object>
{
public AsyncDelegateAccessor(Func<object, string, Task<object>> getter) : base((obj, name, ctx) => getter(obj, name))
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Accessors/DelegateAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Fluid.Accessors
{
public class DelegateAccessor : DelegateAccessor<object, object>
public sealed class DelegateAccessor : DelegateAccessor<object, object>
{
public DelegateAccessor(Func<object, string, object> getter) : base((obj, name, ctx) => getter(obj, name))
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Accessors/MethodInfoAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Fluid.Accessors
{
public class MethodInfoAccessor : IMemberAccessor
public sealed class MethodInfoAccessor : IMemberAccessor
{
private readonly MethodInfo _methodInfo;

Expand Down
2 changes: 1 addition & 1 deletion Fluid/Accessors/PropertyInfoAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Fluid.Accessors
{
public class PropertyInfoAccessor : IMemberAccessor
public sealed class PropertyInfoAccessor : IMemberAccessor
{
private readonly IInvoker _invoker;

Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/AssignStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid.Ast
{
public class AssignStatement : Statement
public sealed class AssignStatement : Statement
{
public AssignStatement(string identifier, Expression value)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/BinaryExpressions/StartsWithBinaryExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Fluid.Ast.BinaryExpressions
{
public class StartsWithBinaryExpression : BinaryExpression
public sealed class StartsWithBinaryExpression : BinaryExpression
{
public StartsWithBinaryExpression(Expression left, Expression right) : base(left, right)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/BinaryExpressions/SubstractBinaryExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Fluid.Ast.BinaryExpressions
{
public class SubstractBinaryExpression : BinaryExpression
public sealed class SubstractBinaryExpression : BinaryExpression
{
public SubstractBinaryExpression(Expression left, Expression right) : base(left, right)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/BreakStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Fluid.Ast
{
public class BreakStatement : Statement
public sealed class BreakStatement : Statement
{
public override ValueTask<Completion> WriteToAsync(TextWriter writer, TextEncoder encoder, TemplateContext context)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/CallbackStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Fluid.Ast
/// <summary>
/// An instance of this class is used to execute some custom code in a template.
/// </summary>
public class CallbackStatement : Statement
public sealed class CallbackStatement : Statement
{
public CallbackStatement(Func<TextWriter, TextEncoder, TemplateContext, ValueTask<Completion>> action)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/CaptureStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Fluid.Ast
{
public class CaptureStatement : TagStatement
public sealed class CaptureStatement : TagStatement
{
public CaptureStatement(string identifier, List<Statement> statements): base(statements)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/CaseStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Fluid.Ast
{
public class CaseStatement : TagStatement
public sealed class CaseStatement : TagStatement
{
private readonly WhenStatement[] _whenStatements;

Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/CommentStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid.Ast
{
public class CommentStatement : Statement
public sealed class CommentStatement : Statement
{
private readonly TextSpan _text;

Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/ContinueStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Fluid.Ast
{
public class ContinueStatement : Statement
public sealed class ContinueStatement : Statement
{
public override ValueTask<Completion> WriteToAsync(TextWriter writer, TextEncoder encoder, TemplateContext context)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/DecrementStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid.Ast
{
public class DecrementStatement : Statement
public sealed class DecrementStatement : Statement
{
public DecrementStatement(string identifier)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/ElseIfStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid.Ast
{
public class ElseIfStatement : TagStatement
public sealed class ElseIfStatement : TagStatement
{
public ElseIfStatement(Expression condition, List<Statement> statements) : base(statements)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/ElseStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid.Ast
{
public class ElseStatement : TagStatement
public sealed class ElseStatement : TagStatement
{
public ElseStatement(List<Statement> statements) : base(statements)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/FilterExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Fluid.Ast
{
public class FilterExpression : Expression
public sealed class FilterExpression : Expression
{
public FilterExpression(Expression input, string name, List<FilterArgument> parameters)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/ForStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Fluid.Ast
{
public class ForStatement : TagStatement
public sealed class ForStatement : TagStatement
{
private bool _isContinueOffset;
private string _continueOffsetLiteral;
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/FunctionCallSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid.Ast
{
public class FunctionCallSegment : MemberSegment
public sealed class FunctionCallSegment : MemberSegment
{
private static readonly FunctionArguments NonCacheableArguments = new();
private volatile FunctionArguments _cachedArguments;
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/IdentifierSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Fluid.Ast
{
[DebuggerDisplay("{Identifier,nq}")]
public class IdentifierSegment : MemberSegment
public sealed class IdentifierSegment : MemberSegment
{
public IdentifierSegment(string identifier)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/IfStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Fluid.Ast
{
public class IfStatement : TagStatement
public sealed class IfStatement : TagStatement
{
private readonly List<ElseIfStatement> _elseIfStatements;

Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/IncludeStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Fluid.Ast
{
#pragma warning disable CA1001 // Types that own disposable fields should be disposable
public class IncludeStatement : Statement
public sealed class IncludeStatement : Statement
#pragma warning restore CA1001
{
public const string ViewExtension = ".liquid";
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/IncrementStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid.Ast
{
public class IncrementStatement : Statement
public sealed class IncrementStatement : Statement
{
public const string Prefix = "$$incdec$$$";
public IncrementStatement(string identifier)
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/IndexerSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Fluid.Ast
{
public class IndexerSegment : MemberSegment
public sealed class IndexerSegment : MemberSegment
{
public IndexerSegment(Expression expression)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/LiquidStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid.Ast
{
public class LiquidStatement : TagStatement
public sealed class LiquidStatement : TagStatement
{
public LiquidStatement(List<Statement> statements) : base(statements)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/MacroStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Fluid.Ast
{
public class MacroStatement : TagStatement
public sealed class MacroStatement : TagStatement
{
public MacroStatement(string identifier, IReadOnlyList<FunctionCallArgument> arguments, List<Statement> statements): base(statements)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/MemberExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid.Ast
{
public class MemberExpression : Expression
public sealed class MemberExpression : Expression
{
public MemberExpression(params MemberSegment[] segments)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/NamedExpressionList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Fluid.Ast
{
public class NamedExpressionList
public sealed class NamedExpressionList
{
public static readonly NamedExpressionList Empty = new NamedExpressionList();

Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/OutputStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Fluid.Ast
{
public class OutputStatement : Statement
public sealed class OutputStatement : Statement
{
public OutputStatement(Expression expression)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/RangeExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid.Ast
{
public class RangeExpression : Expression
public sealed class RangeExpression : Expression
{
public RangeExpression(Expression from, Expression to)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/RawStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Fluid.Ast
{
public class RawStatement : Statement
public sealed class RawStatement : Statement
{
private readonly TextSpan _text;

Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/RenderStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Fluid.Ast
/// The render tag can only access immutable environments, which means the scope of the context that was passed to the main template, the options' scope, and the model.
/// </summary>
#pragma warning disable CA1001 // Types that own disposable fields should be disposable
public class RenderStatement : Statement
public sealed class RenderStatement : Statement
#pragma warning restore CA1001
{
public const string ViewExtension = ".liquid";
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/UnlessStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid.Ast
{
public class UnlessStatement : TagStatement
public sealed class UnlessStatement : TagStatement
{
public UnlessStatement(
Expression condition,
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Ast/WhenStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Fluid.Ast
{
public class WhenStatement : TagStatement
public sealed class WhenStatement : TagStatement
{
private readonly IReadOnlyList<Expression> _options;

Expand Down
2 changes: 1 addition & 1 deletion Fluid/FilterArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Fluid
/// Represents the list of arguments that are passed to a <see cref="FilterDelegate"/>
/// when invoked.
/// </summary>
public class FilterArguments
public sealed class FilterArguments
{
public static readonly FilterArguments Empty = new FilterArguments();

Expand Down
2 changes: 1 addition & 1 deletion Fluid/FiltersCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Fluid
{
public class FilterCollection : IEnumerable<KeyValuePair<string, FilterDelegate>>
public sealed class FilterCollection : IEnumerable<KeyValuePair<string, FilterDelegate>>
{
private Dictionary<string, FilterDelegate> _filters;

Expand Down
2 changes: 1 addition & 1 deletion Fluid/FunctionArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Fluid
/// <summary>
/// Represents the list of arguments of a function.
/// </summary>
public class FunctionArguments
public sealed class FunctionArguments
{
public static readonly FunctionArguments Empty = new FunctionArguments();

Expand Down
2 changes: 1 addition & 1 deletion Fluid/MemberNameStrategies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Fluid
{
public class MemberNameStrategies
public sealed class MemberNameStrategies
{
public static readonly MemberNameStrategy Default = RenameDefault;
public static readonly MemberNameStrategy CamelCase = RenameCamelCase;
Expand Down
2 changes: 1 addition & 1 deletion Fluid/NullMemberAccessor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Fluid
{
public class NullMemberAccessor : IMemberAccessor
public sealed class NullMemberAccessor : IMemberAccessor
{
public static readonly IMemberAccessor Instance = new NullMemberAccessor();

Expand Down
2 changes: 1 addition & 1 deletion Fluid/ParseException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Fluid
{
public class ParseException : Exception
public sealed class ParseException : Exception
{
//
// Summary:
Expand Down
2 changes: 1 addition & 1 deletion Fluid/Parser/CompositeFluidTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid.Parser
{
public class CompositeFluidTemplate : IFluidTemplate
public sealed class CompositeFluidTemplate : IFluidTemplate
{
private readonly List<IFluidTemplate> _templates;

Expand Down
2 changes: 1 addition & 1 deletion Fluid/Parser/FluidTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Fluid.Parser
{
public class FluidTemplate : IFluidTemplate
public sealed class FluidTemplate : IFluidTemplate
{
private readonly List<Statement> _statements;

Expand Down
2 changes: 1 addition & 1 deletion Fluid/Scope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Fluid
{
public class Scope
public sealed class Scope
{
private Dictionary<string, FluidValue> _properties;
private readonly bool _forLoopScope;
Expand Down
2 changes: 1 addition & 1 deletion Fluid/UnsafeMemberAccessStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Fluid
{
public class UnsafeMemberAccessStrategy : DefaultMemberAccessStrategy
public sealed class UnsafeMemberAccessStrategy : DefaultMemberAccessStrategy
{
public static readonly UnsafeMemberAccessStrategy Instance = new UnsafeMemberAccessStrategy();

Expand Down