Skip to content

Crash occurs while attempting to use _printChanges() on a reducer that utilizes @Shared #136

@kevinanderson7

Description

@kevinanderson7

Description

After upgrading our project that utilizes TCA and swift-sharing to use version 2.3.1 of swift-sharing, we are noticing a crash that occurs whenever the _printChanges() is used while debugging reducer state that leverages the @shared property wrapper. I have created a minimal project that reproduces the issue. We did not seem to see a crash while using swift-sharing 1.1.3, but from what I can tell, the issue seems to begin starting with version 2.0.0.

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

I would expect the _printChanges() function to print out changes without crashing for reducer state that utilizes the @shared property wrapper.

Actual behavior

A crash is observed as soon as _printChanges() is applied to the reducer.

Reproducing project

sharing-regression.zip

Sharing version information

2.3.1

Destination operating system

iOS 18.3.1

Xcode version information

Xcode 16.2

Swift Compiler version information

swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions