diff --git a/PKHeX.Core/Editing/Saves/Slots/SlotChangelog.cs b/PKHeX.Core/Editing/Saves/Slots/SlotChangelog.cs index 5cdd45348..186d04efc 100644 --- a/PKHeX.Core/Editing/Saves/Slots/SlotChangelog.cs +++ b/PKHeX.Core/Editing/Saves/Slots/SlotChangelog.cs @@ -55,7 +55,7 @@ private static SlotReversion GetReversion(ISlotInfo info, SaveFile sav) { return info switch { - SlotInfoParty p => (SlotReversion) new PartyReversion(p, sav), + SlotInfoParty p => new PartyReversion(p, sav), _ => new SingleSlotReversion(info, sav) }; } diff --git a/PKHeX.Core/Legality/Analysis.cs b/PKHeX.Core/Legality/Analysis.cs index cc708c8a8..1be9c5ef5 100644 --- a/PKHeX.Core/Legality/Analysis.cs +++ b/PKHeX.Core/Legality/Analysis.cs @@ -170,7 +170,7 @@ private Action GetParseMethod() 2 => ParsePK7, 7 => ParsePK7, - 8 => (Action)ParsePK8, + 8 => ParsePK8, _ => throw new Exception() }; diff --git a/PKHeX.Core/Legality/Core.cs b/PKHeX.Core/Legality/Core.cs index fe5fab3c9..d31fa85b7 100644 --- a/PKHeX.Core/Legality/Core.cs +++ b/PKHeX.Core/Legality/Core.cs @@ -373,7 +373,7 @@ internal static ICollection GetWildBalls(PKM pkm) 6 => WildPokeballs6, 7 => (pkm.GG ? WildPokeballs7b : WildPokeballs7), 8 => WildPokeballs8, - _ => (ICollection)Array.Empty() + _ => Array.Empty() }; } @@ -431,7 +431,7 @@ internal static ICollection GetFutureGenEvolutions(int generation) 3 => FutureEvolutionsGen3, 4 => FutureEvolutionsGen4, 5 => FutureEvolutionsGen5, - _ => (ICollection)Array.Empty() + _ => Array.Empty() }; } diff --git a/PKHeX.Core/Legality/Encounters/Generator/EncounterMovesetGenerator.cs b/PKHeX.Core/Legality/Encounters/Generator/EncounterMovesetGenerator.cs index 3e5326b1e..b42b2764e 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/EncounterMovesetGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/EncounterMovesetGenerator.cs @@ -150,7 +150,7 @@ private static IEnumerable GetPossibleOfType(PKM pk, IReadOnlyCo { return type switch { - EncounterOrder.Egg => (IEnumerable)GetEggs(pk, needs, version), + EncounterOrder.Egg => GetEggs(pk, needs, version), EncounterOrder.Mystery => GetGifts(pk, needs), EncounterOrder.Static => GetStatic(pk, needs), EncounterOrder.Trade => GetTrades(pk, needs), diff --git a/PKHeX.Core/Legality/Moves/MoveLevelUp.cs b/PKHeX.Core/Legality/Moves/MoveLevelUp.cs index 99414c594..913cdcb90 100644 --- a/PKHeX.Core/Legality/Moves/MoveLevelUp.cs +++ b/PKHeX.Core/Legality/Moves/MoveLevelUp.cs @@ -275,7 +275,7 @@ public static IEnumerable GetMovesLevelUp(PKM pkm, int species, int minlvlG 6 => GetMovesLevelUp6(species, form, lvl, version), 7 => GetMovesLevelUp7(species, form, lvl, MoveReminder, version), 8 => GetMovesLevelUp8(species, form, lvl, version), - _ => (IEnumerable)Array.Empty() + _ => Array.Empty() }; } diff --git a/PKHeX.Core/PKM/Searching/SearchUtil.cs b/PKHeX.Core/PKM/Searching/SearchUtil.cs index 8015b06a4..2a9bd6b33 100644 --- a/PKHeX.Core/PKM/Searching/SearchUtil.cs +++ b/PKHeX.Core/PKM/Searching/SearchUtil.cs @@ -108,7 +108,7 @@ public static IEnumerable FilterByBatchInstruction(IEnumerable res, IL return Clones switch { CloneDetectionMethod.HashPID => HashByPID, - _ => (Func)HashByDetails, + _ => HashByDetails, }; } diff --git a/PKHeX.Core/PKM/Util/PKMConverter.cs b/PKHeX.Core/PKM/Util/PKMConverter.cs index 780fbe703..0cb223d54 100644 --- a/PKHeX.Core/PKM/Util/PKMConverter.cs +++ b/PKHeX.Core/PKM/Util/PKMConverter.cs @@ -121,7 +121,7 @@ public static int GetPKMDataFormat(byte[] data) { PokeCrypto.SIZE_3CSTORED => new CK3(data), PokeCrypto.SIZE_3XSTORED => new XK3(data), - _ => (PKM)new PK3(data) + _ => new PK3(data) }; case 4: var pk = new PK4(data); diff --git a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs index b6dc16b53..de9efad24 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs @@ -604,7 +604,7 @@ private static Form GetTrainerEditor(SaveFile sav) SAV7 s7 => new SAV_Trainer7(s7), SAV7b b7 => new SAV_Trainer7GG(b7), SAV8SWSH swsh => new SAV_Trainer8(swsh), - _ => (Form) new SAV_SimpleTrainer(sav) + _ => new SAV_SimpleTrainer(sav) }; } diff --git a/Tests/PKHeX.Core.Tests/Legality/LegalityTests.cs b/Tests/PKHeX.Core.Tests/Legality/LegalityTests.cs index d37b05fc7..fca90fbbf 100644 --- a/Tests/PKHeX.Core.Tests/Legality/LegalityTests.cs +++ b/Tests/PKHeX.Core.Tests/Legality/LegalityTests.cs @@ -75,6 +75,7 @@ private static void VerifyAll(string folder, string name, bool isValid) legality.Valid.Should().BeTrue($"because the file '{fi.Directory.Name}\\{fi.Name}' should be invalid, but found:{Environment.NewLine}{msg}"); } } + ctr.Should().BeGreaterThan(0); } } }