diff --git a/.editorconfig b/.editorconfig index 2d9d943985..e594195d29 100644 --- a/.editorconfig +++ b/.editorconfig @@ -216,6 +216,9 @@ dotnet_diagnostic.IDE0120.severity = warning # Use tuple to swap values. dotnet_diagnostic.IDE0180.severity = warning +# Make struct 'readonly'. +dotnet_diagnostic.IDE0250.severity = warning + # Naming rule violation. dotnet_diagnostic.IDE1006.severity = warning diff --git a/OpenRA.Game/Network/SyncReport.cs b/OpenRA.Game/Network/SyncReport.cs index 7eb2097a7e..eb7be5f125 100644 --- a/OpenRA.Game/Network/SyncReport.cs +++ b/OpenRA.Game/Network/SyncReport.cs @@ -188,7 +188,7 @@ namespace OpenRA.Network public (string[] Names, Values Values) NamesValues; } - struct TypeInfo + readonly struct TypeInfo { static readonly ParameterExpression SyncParam = Expression.Parameter(typeof(ISync), "sync"); static readonly ConstantExpression NullString = Expression.Constant(null, typeof(string)); diff --git a/OpenRA.Mods.Common/Traits/World/ResourceLayer.cs b/OpenRA.Mods.Common/Traits/World/ResourceLayer.cs index 7c6eb8f793..498eedee5f 100644 --- a/OpenRA.Mods.Common/Traits/World/ResourceLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/ResourceLayer.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - public struct ResourceLayerContents + public readonly struct ResourceLayerContents { public static readonly ResourceLayerContents Empty = default; public readonly string Type;