Skip to content

Hyphenation difference between "nonisolated" and other forms of isolation diagnostics #73982

@mattmassicotte

Description

@mattmassicotte

Description

Everywhere I can find, hyphenation is used both in documentation and diagnostics for isolation. "actor-isolated", "task-isolated". But in this example, the warning uses "nonisolated".

14 | 
15 | 	await updateUI(with: style)
   |        |- error: sending 'style' risks causing data races
   |        `- note: sending 'style' to main actor-isolated global function 'updateUI(with:)' risks causing data races between main actor-isolated and local nonisolated uses
16 | 
17 | 	style.store()
   |        `- note: access can happen concurrently
18 | }
19 | 

Reproduction

// Non-Sendable reference type
class Style {
	func store() {
	}
}

@MainActor
func updateUI(with style: Style) {
}

// a non-isolated use
func refresh() async {
	let style = Style()

	await updateUI(with: style)

	style.store()
}

Expected behavior

I would expect this to use "non-isolated:

note: sending 'style' to main actor-isolated global function 'updateUI(with:)' risks causing data races between main actor-isolated and local non-isolated uses

Environment

Apple Swift version 6.0-dev (LLVM 4b0b1f9e1a69523, Swift 91a3abc)
Target: arm64-apple-macosx14.0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    compilerThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresdiagnostics QoIBug: Diagnostics Quality of Implementationimprovementtype checkerArea → compiler: Semantic analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions