Skip to content

Commit 51bf405

Browse files
authored
Merge pull request #146 from xodial/xodial/fix-state-logic-extensions
chore: keep OnEnter/OnExit from being suggested for every type
2 parents 891ca53 + 72c5a6b commit 51bf405

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)