Skip to content

Isolation errors incorrectly reported as other errors without details #83312

@cameronmcefee

Description

@cameronmcefee

Description

Sorry, I'm a bit out of my domain here, but I think this is the right place to report this. I originally reported what I thought was a bug with TCA docs in pointfreeco/swift-composable-architecture#3733. The issue I saw was that a macro that applied conformance to a protocol was failing with with a warning that the conformance wasn't satisfied:

Type 'CounterFeature' does not conform to protocol 'Reducer' That's all it gave me, with no "fix it" to add stubs or any further explanation.

Image

However it was pointed out in the issue that the code that was causing protocol conformance errors in Xcode 26 Beta 4 compiled file in Xcode 16. Further, it was pointed out that it has to do with the default isolation set in the new version of Xcode. Sure enough, adding nonisolated to the structs in the failing code fixed the build error. I would have never figured that out.

With the standard project settings (which curiously had default isolation as nonisolated), the result is a compiler error Type 'CounterFeature' does not conform to protocol 'Reducer' as mentioned before. However out of curiosity, I configured the project to use Swift 6 (it was unspecified to start), Approachable Concurrency = YES and Default Isolation = MainActor.

At that point the compiler started failing stating that CounterFeature is a circular reference.

Image

Again, adding nonisolated to the structs fixes the error.

I wish I could be more help here, but this is far beyond me at this point.

Reproduction

I wish I could provide a markdown version, but I'm not sure how to reproduce the dependency that is required to trigger it. Here's a basic project that can reproduce it.

You should be able to just try to build it to trigger the error in CounterFeature.swift

The fix is to add nonisolated to CounterFeature, State, and Action

Expected behavior

Things should compile fine

Environment

I believe this is 6.2 which ships with Xcode 26 beta 4

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions