Skip to content

When compiling in release mode in Xcode 16 Beta 6 , compilation fails #264

@Gernot

Description

@Gernot

Description

In 1.3.8, in WithDependencies.swift, compilation fails in Line 491:

  @_transparent
  private func isSetting<R>(
    _ value: Bool,
    isolation: isolated (any Actor)? = #isolation,
    operation: () async throws -> R
  ) async rethrows -> R {
    #if DEBUG
      try await DependencyValues.$isSetting.withValue(value, operation: operation)
    #else
      // ERROR:  Non-sendable type 'R' returned by implicitly asynchronous call to nonisolated function cannot cross actor boundary
      try await operation()
    #endif
  }

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

Project compiles

Actual behavior

Project does not compile

Steps to reproduce

No response

Dependencies version information

1.3.8

Destination operating system

No response

Xcode version information

Xcode 16 Beta 6

Swift Compiler version information

No response

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