You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am aware that this library is not responsible of adding/removing/changing phone number formats and any request should be done at libphonenumber repo
Steps to reproduce
The following code in a concurrent background thread produces a data race when the Thread Sanitizer is enabled:
structContactData{letnumber:[String]}letutility=PhoneNumberUtility()letdataArray:[ContactData]=[...]
for item in dataArray {
utility.parse(item.numbers)}
Expected result
No warning, nor data race.
Actual result
There is a data race accessing the hasError property:
Data race in closure #1 @Sendable (Swift.Int) -> () in closure #1 (inout Swift.UnsafeMutableBufferPointer<PhoneNumberKit.PhoneNumber>, inout Swift.Int) -> () in PhoneNumberKit.ParseManager.parseMultiple(_: Swift.Array<Swift.String>, withRegion: Swift.String, ignoreType: Swift.Bool, shouldReturnFailedEmptyNumbers: Swift.Bool) -> Swift.Array<PhoneNumberKit.PhoneNumber>
2, Opening the Project in Xcode 16.1 on master, shows a warning on line 112:
Capture of 'buffer' with non-sendable type 'UnsafeMutableBufferPointer<PhoneNumber>' in a `@Sendable` closure; this is an error in the Swift 6 language mode
Environment
Xcode 16.1 + SPM (v4.0.1 / master)
The text was updated successfully, but these errors were encountered:
New Issue Checklist
Steps to reproduce
The following code in a concurrent background thread produces a data race when the
Thread Sanitizer
is enabled:Expected result
No warning, nor data race.
Actual result
hasError
property:2, Opening the Project in Xcode 16.1 on
master
, shows a warning on line 112:Environment
Xcode 16.1 + SPM (
v4.0.1
/master
)The text was updated successfully, but these errors were encountered: