Skip to content

Region-based isolation regression in 6.2 toolchain #82371

Open
@Wouter01

Description

@Wouter01

Description

Hi,

I noticed that the latest version of the main branch of the Neon library does not compile anymore using the latest 6.2 toolchain (or the one provided by Xcode 26 beta 1). The library compiles fine using swift 6.1.

The following error get's produced:
Pattern that the region based isolation checker does not understand how to check. Please file a bug

Reproduction

The error appears for the following piece of code.

var validationProvider: HybridSyncAsyncValueProvider<Validator.ContentRange, Validation, Never> {
	.init( // Pattern that the region based isolation checker does not understand how to check. Please file a bug
		syncValue: { self.validate($0) },
		asyncValue: { _, range in await self.validate(range)}
	)
}

I was able to let it compile successfully with the help of @mattmassicotte by putting the closure in a separate variable:

var validationProvider: HybridSyncAsyncValueProvider<Validator.ContentRange, Validation, Never> {
	let asyncValue: HybridSyncAsyncValueProvider<Validator.ContentRange, Validation, Never>.AsyncValueProvider = { _, range in await self.validate(range)}
	return .init(
		syncValue: { self.validate($0) },
		asyncValue: asyncValue
	)
}

I tried to reproduce the error using a smaller example but couldn't reproduce it, my apologies for that.

Expected behavior

The code compiles

Environment

swift-driver version: 1.127.4.2 Apple Swift version 6.2 (swiftlang-6.2.0.9.909 clang-1700.3.9.907)

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