Skip to content

Reducer Circular reference #3808

Description

@Juribu

Description

I'm getting this issue of circular reference. How do I resolve it?

The issue is with the macro as when I used the non macro version, it worked. But in a different project, the macro works with var body: some ReducerOf

import Foundation
import ComposableArchitecture

@Reducer
struct Pomodoro {
@ObservableState
struct State: Equatable {
var isTimerActive = false
}

enum Action: Equatable {
    case startTapped
    case stopTapped
}

var body: some ReducerOf<Self> {
    Reduce { state, action in
        switch action {
        case .startTapped:
            state.isTimerActive = true
            return .none
        case .stopTapped:
            state.isTimerActive = false
            return .none
        }
    }
}

}
Image

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

Image

Actual behavior

No response

Reproducing project

No response

The Composable Architecture version information

1.23.0

Destination operating system

No response

Xcode version information

xcode 26

Swift Compiler version information

swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.0.19.9 clang-1700.3.19.1)
Target: arm64-apple-macosx26.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions