mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
* Add PreferOtherTypeAttribute, analyzer, and test. * nullable enable * Add nuget package for CodeFix verifier * Add fixer for PreferOtherType * Rename arguments * Adjust diagnostic message * Move attribute lookup
19 lines
584 B
C#
19 lines
584 B
C#
using System;
|
|
|
|
#if ROBUST_ANALYZERS_IMPL
|
|
namespace Robust.Shared.Analyzers.Implementation;
|
|
#else
|
|
namespace Robust.Shared.Analyzers;
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Marks that use of a generic Type should be replaced with a specific other Type
|
|
/// when the type argument T is a certain Type.
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
|
|
public sealed class PreferOtherTypeAttribute(Type genericType, Type replacementType) : Attribute
|
|
{
|
|
public readonly Type GenericArgument = genericType;
|
|
public readonly Type ReplacementType = replacementType;
|
|
}
|