XCode 16 beta 3 with Swift 6 mode: error using default parameters when calling function from actor

When calling an actor's function from outside (using a Task and "await") if the function has some default parameters in its definition, if I don't explicitly set all parameters on the call, I get an error: "Sending 'self'-isolated value of type 'Bool' with later accesses to actor-isolated context risks causing data races". In this case the parameter in question is a Bool, but the same happens with other types.

Is this the intended behaviour? Does it make sense? For now I'm just setting those parameters on the calling function and the error goes away but it removes all the benefit of having those default values in the first place...

1 Like