Replies: 1 comment 2 replies
-
Hi @Budyn, can you provide a complete, compiling sample that demonstrates the problem? This compiles just fine with no warnings: protocol FetchService {}
struct LiveFetchService: FetchService {}
enum FetchServiceKey: DependencyKey {
static let liveValue: any FetchService = LiveFetchService()
}
func foo() {
@Dependency(FetchServiceKey.self) var fetchService
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm migrating the Dependencies package to 1.2, so the new overriding dependecies technique can be used.
My project has protocol oriented dependencies.
In order to use this syntax:
@Dependency(FetchServiceKey.self) var fetchService
I have to include the testValue inside the DependencyKey object:
By commenting out the testValue from the DependencyKey, I can't build the project and have a warning:
Do we need to include the testValue each time for this overriding method?
Beta Was this translation helpful? Give feedback.
All reactions