Files
RobustToolbox/Robust.Shared/Analyzers/VirtualAttribute.cs
Pieter-Jan Briers 72d893dec5 Add "obsolete inheritance" analyzer (#5858)
This allows us to make it obsolete to *inherit* from a class, and only that.

Intended so people stop inheriting UI controls for no good reason.

Fixes #5856
2025-04-19 17:29:17 +10:00

17 lines
475 B
C#

using System;
namespace Robust.Shared.Analyzers;
/// <summary>
/// Specify that this class is allowed to be inherited.
/// </summary>
/// <remarks>
/// Robust uses analyzers to prevent accidental usage of non-sealed classes:
/// a class must be either marked [Virtual], abstract, or sealed.
/// </remarks>
/// <seealso cref="ObsoleteInheritanceAttribute"/>
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public sealed class VirtualAttribute : Attribute
{
}