Skip to content

Commit

Permalink
Removed unecessary generic type
Browse files Browse the repository at this point in the history
ExpectedSideEffect had a unnecessary WorkflowType that was shadowing the outer WorkflowType type.
  • Loading branch information
mjohnson12 committed Feb 13, 2024
1 parent eb88fbd commit 6d77614
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions WorkflowTesting/Sources/Internal/RenderExpectations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extension RenderTester {
}

extension RenderTester {
internal class ExpectedSideEffect<WorkflowType: Workflow> {
internal class ExpectedSideEffect {
let key: AnyHashable
let file: StaticString
let line: UInt
Expand All @@ -62,7 +62,7 @@ extension RenderTester {
func apply<ContextType>(context: ContextType) where ContextType: RenderContextType, ContextType.WorkflowType == WorkflowType {}
}

internal final class ExpectedSideEffectWithAction<WorkflowType, ActionType: WorkflowAction>: ExpectedSideEffect<WorkflowType> where ActionType.WorkflowType == WorkflowType {
internal final class ExpectedSideEffectWithAction<ActionType: WorkflowAction>: ExpectedSideEffect where ActionType.WorkflowType == WorkflowType {
let action: ActionType

internal init(key: AnyHashable, action: ActionType, file: StaticString, line: UInt) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extension RenderTester {
internal final class TestContext: RenderContextType {
var state: WorkflowType.State
var expectedWorkflows: [AnyExpectedWorkflow]
var expectedSideEffects: [AnyHashable: ExpectedSideEffect<WorkflowType>]
var expectedSideEffects: [AnyHashable: ExpectedSideEffect]
var appliedAction: AppliedAction<WorkflowType>?
var producedOutput: WorkflowType.Output?
let file: StaticString
Expand All @@ -34,7 +34,7 @@ extension RenderTester {
internal init(
state: WorkflowType.State,
expectedWorkflows: [AnyExpectedWorkflow],
expectedSideEffects: [AnyHashable: ExpectedSideEffect<WorkflowType>],
expectedSideEffects: [AnyHashable: ExpectedSideEffect],
file: StaticString,
line: UInt
) {
Expand Down
4 changes: 2 additions & 2 deletions WorkflowTesting/Sources/WorkflowRenderTester.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ public struct RenderTester<WorkflowType: Workflow> {
let state: WorkflowType.State

private let expectedWorkflows: [AnyExpectedWorkflow]
private let expectedSideEffects: [AnyHashable: ExpectedSideEffect<WorkflowType>]
private let expectedSideEffects: [AnyHashable: ExpectedSideEffect]

init(
workflow: WorkflowType,
state: WorkflowType.State,
expectedWorkflows: [AnyExpectedWorkflow] = [],
expectedSideEffects: [AnyHashable: ExpectedSideEffect<WorkflowType>] = [:]
expectedSideEffects: [AnyHashable: ExpectedSideEffect] = [:]
) {
self.workflow = workflow
self.state = state
Expand Down

0 comments on commit 6d77614

Please sign in to comment.