---
title: Cross-isolation data race (RegionIsolationCrossIsolationDataRace)
framework: swift-compiler
role: article
role_heading: Article
path: swift-compiler/documentation/diagnostics/region-isolation-cross-isolation-data-race
---

# Cross-isolation data race (RegionIsolationCrossIsolationDataRace)

## Overview

Overview The region-based isolation checker tracks values using regions, which are conservative approximations of object graphs. A region can be either non-isolated or isolated to a single concurrency domain (an actor, a global actor, or the current task), but it can never be isolated to more than one concurrency domain at a time. This error occurs when an operation would merge two regions that are isolated to different concurrency domains. Merging such regions would allow values from both domains to be referenced through the same object graph, risking concurrent access and data races. Common examples include assigning an actor-isolated value to a variable accessible from a different isolation domain, passing values from different isolation domains as arguments to the same function call, or casting a value to a type with different isolation. To resolve this, ensure that values from different isolation domains are not mixed together in ways that could allow concurrent access. Consider making the types involved conform to Sendable, or restructuring the code so that values are only accessed from a single isolation domain.

## See Also

- [@dynamicCallable implementation requirements (DynamicCallable)](swift-compiler/documentation/diagnostics/dynamic-callable-requirements.md)
- [Add @preconcurrency import (AddPreconcurrencyImport)](swift-compiler/documentation/diagnostics/add-preconcurrency-import.md)
- [Always enabled availability domains (AlwaysAvailableDomain)](swift-compiler/documentation/diagnostics/always-available-domain.md)
- [Argument matching for trailing closures (TrailingClosureMatching)](swift-compiler/documentation/diagnostics/trailing-closure-matching.md)
- [Calling a mutating async actor-isolated method (ActorIsolatedMutatingAsync)](swift-compiler/documentation/diagnostics/actor-isolated-mutating-async.md)
- [Calling an actor-isolated method from a synchronous nonisolated context (ActorIsolatedCall)](swift-compiler/documentation/diagnostics/actor-isolated-call.md)
- [Captures in a `@Sendable` closure (SendableClosureCaptures)](swift-compiler/documentation/diagnostics/sendable-closure-captures.md)
- [Compilation caching (CompilationCaching)](swift-compiler/documentation/diagnostics/compilation-caching.md)
- [Conforming to `StringInterpolationProtocol` (StringInterpolationConformance)](swift-compiler/documentation/diagnostics/string-interpolation-conformance.md)
- [Conversion from `@isolated(any)` function type to synchronous function type (ConversionFromIsolatedAnyToSynchronous)](swift-compiler/documentation/diagnostics/conversion-from-isolated-any-to-synchronous.md)
- [Deprecated declaration warnings (DeprecatedDeclaration)](swift-compiler/documentation/diagnostics/deprecated-declaration.md)
- [Deprecated implementation-only imports (ImplementationOnlyDeprecated)](swift-compiler/documentation/diagnostics/implementation-only-deprecated.md)
- [Dynamic exclusivity (DynamicExclusivity)](swift-compiler/documentation/diagnostics/dynamic-exclusivity.md)
- [Embedded Swift language restrictions (EmbeddedRestrictions)](swift-compiler/documentation/diagnostics/embedded-restrictions.md)
- [Existential Types and Performance (ExistentialType)](swift-compiler/documentation/diagnostics/existential-type.md)
