79580400

Date: 2025-04-18 03:48:57
Score: 1.5
Natty:
Report link

I found a solution

If you add a @Sendable the warning will disappear

func foo()async throws {
      let ctx = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType);
      //..
      try await ctx.perform{ @Sendable in // warning disappear
        if ctx.hasChanges {
          try ctx.save();
        }
      }
    }
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @Sendable
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: john07