Skip to content

This isolation diagnostic lacks enough context to understand easily #79077

Open
@mattmassicotte

Description

@mattmassicotte

Description

Minor grammar issue aside, this diagnostic doesn't really provide enough context to fully understand which two actors are being referenced. This is better in the global-actor case.

Reproduction

actor MyActor {
	var value = 1
}

actor MyOtherActor {
	// error: Actor-isolated default value in a actor-isolated context
	let value = MyActor().value
}

Expected behavior

I think I'd like to see references either to self or to the actor types somehow? I'm not 100% sure, but as-is doesn't feel particularly ideal.

Environment

Apple Swift version 6.1-dev (LLVM a321a98f4e5b06a, Swift 7a0a6e7)
Target: arm64-apple-macosx15.0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.concurrencyFeature: umbrella label for concurrency language features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions