No warning or error is thrown when an instance of a class with mutable state instance is assigned to Sendable variable #60054
Labels
accepts invalid
Bug: Accepts invalid
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
concurrency
Feature: umbrella label for concurrency language features
conformances
Feature → protocol: protocol conformances
Sendable
Area → standard library: The Sendable protocol
swift 5.9
type checker
Area → compiler: Semantic analysis
Describe the bug
On Swift 5.7 (see environment) when an instance of a class with a mutable state is assigned to a
Sendablevariable, no warning error or error is thrownSteps To Reproduce
Expected behavior
An error or warning needs to be thrown compiling the line
let s: Sendable = carEnvironment
The text was updated successfully, but these errors were encountered: