Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package import OpenGraphShims
/// The only change the effect makes to the view's ancestors and descendants is
/// to change the coordinate transform to and from them.
@available(OpenSwiftUI_v1_0, *)
public protocol GeometryEffect: Animatable, ViewModifier where Body == Never {
public protocol GeometryEffect: Animatable, ViewModifier, _RemoveGlobalActorIsolation where Body == Never {
/// Returns the current value of the effect.
func effectValue(size: CGSize) -> ProjectionTransform

Expand Down
15 changes: 0 additions & 15 deletions Sources/OpenSwiftUICore/Util/ImpossibleActor.swift

This file was deleted.

26 changes: 26 additions & 0 deletions Sources/OpenSwiftUICore/Util/_RemoveGlobalActor.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// _RemoveGlobalActor.swift
// OpenSwiftUICore
//
// Audited for 6.5.4
// Status: Complete
// ID: E36588D6F4797F7C6EF26CC7E1C2D1CE

@globalActor
public actor _ImpossibleActor: Sendable {
public static var shared = _ImpossibleActor()

public nonisolated var unownedExecutor: UnownedSerialExecutor {
_ImpossibleExecutor().asUnownedSerialExecutor()
}
}

private final class _ImpossibleExecutor: SerialExecutor {
func enqueue(_ job: consuming ExecutorJob) {
preconditionFailure("_RemoveGlobalActorIsolation is not intended to be used as a stand-alone protocol with a global actor isolation.")
}
}

@_marker
@_ImpossibleActor
public protocol _RemoveGlobalActorIsolation {}
33 changes: 33 additions & 0 deletions Tests/OpenSwiftUICoreTests/Util/_RemoveGlobalActorTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// _RemoveGlobalActorTests.swift
// OpenSwiftUICoreTests

import OpenSwiftUICore
import Testing

// MARK: - _RemoveGlobalActorTests

struct _RemoveGlobalActorTests {
@MainActor
protocol P {}

@Test
func removeGlobalActorIsolation() {
struct A: P, _RemoveGlobalActorIsolation {
static func p() {}
}
A.p()
}

#if compiler(>=6.2)
@Test
func standaloneConstraintCrash() async {
struct B: _RemoveGlobalActorIsolation {
static func p() {}
}
await #expect(processExitsWith: .failure) {
await B.p()
}
}
#endif
}