hmlongco / Factory

A new approach to Container-Based Dependency Injection for Swift and SwiftUI.
MIT License
1.87k stars 115 forks source link

Getting structured concurrency warning when using property wrappers #41

Closed lukacs-m closed 1 year ago

lukacs-m commented 1 year ago

Hello,

I have recently been working on a project where I switched the Stricted concurrency checking too complete. After doing that I end up with several concurrency warning for @Injected variables.

final class GetCurrentLyrics: GetCurrentLyricsUseCase, Sendable {
    //// Warning on this variable
    @Injected(UseCasesContainer.getCurrentMedia) private var getCurrentMedia: GetCurrentMediaUseCase

   xxxxxx rest of code
}

The @Injected variable produces the following warning: Stored property '_getCurrentMedia' of 'Sendable'-conforming class 'GetCurrentLyrics' is mutable. Could there be a way to remove this warning ?

Never the less thank you very much for this wonderful tool that is Factory.

hmlongco commented 1 year ago

Did you try it w/o the property wrapper?

private let getCurrentMedia = UseCasesContainer.getCurrentMedia()
lukacs-m commented 1 year ago

As of now no :) But will do :)