Skip to content

Commit 72c5a6b

Browse files
committed
chore: keep OnEnter/OnExit from being suggested for every type
1 parent 891ca53 commit 72c5a6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Chickensoft.LogicBlocks/src/StateLogicExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static void OnEnter<TBaseState, TDerivedState>(
4747
Action<TBaseState?> handler
4848
)
4949
where TBaseState : StateBase
50-
where TDerivedState : TBaseState =>
50+
where TDerivedState : StateBase, TBaseState =>
5151
state.OnEnter<TDerivedState>((previous) => handler(previous as TBaseState));
5252

5353
/// <summary>
@@ -91,6 +91,6 @@ public static void OnExit<TBaseState, TDerivedState>(
9191
Action<TBaseState?> handler
9292
)
9393
where TBaseState : StateBase
94-
where TDerivedState : TBaseState =>
94+
where TDerivedState : StateBase, TBaseState =>
9595
state.OnExit<TDerivedState>((next) => handler(next as TBaseState));
9696
}

0 commit comments

Comments
 (0)