diff --git a/Sources/Dependencies/DependencyValues.swift b/Sources/Dependencies/DependencyValues.swift index 6b8cf023..ed05aecd 100644 --- a/Sources/Dependencies/DependencyValues.swift +++ b/Sources/Dependencies/DependencyValues.swift @@ -419,12 +419,15 @@ private final class CachedValues: @unchecked Sendable { \(dependencyDescription) - Every dependency registered with the library must conform to 'DependencyKey', and \ - that conformance must be visible to the running application. + To fix you can do one of two things: - To fix, make sure that '\(typeName(Key.self))' conforms to 'DependencyKey' by \ - providing a live implementation of your dependency, and make sure that the \ - conformance is linked with this current application. + * Conform '\(typeName(Key.self))' to the 'DependencyKey' protocol by providing \ + a live implementation of your dependency, and make sure that the conformance is \ + linked with this current application. + + * Override the implementation of '\(typeName(Key.self))' using 'withDependencies'. \ + This is typically done at the entry point of your application, but can be done \ + later too. """, file: DependencyValues.currentDependency.file ?? file, line: DependencyValues.currentDependency.line ?? line diff --git a/Tests/DependenciesTests/DependencyValuesTests.swift b/Tests/DependenciesTests/DependencyValuesTests.swift index 72efc732..4ac3f23a 100644 --- a/Tests/DependenciesTests/DependencyValuesTests.swift +++ b/Tests/DependenciesTests/DependencyValuesTests.swift @@ -37,12 +37,14 @@ final class DependencyValuesTests: XCTestCase { Value: Int - Every dependency registered with the library must conform to 'DependencyKey', and that \ - conformance must be visible to the running application. + To fix you can do one of two things: - To fix, make sure that 'TestKey' conforms to 'DependencyKey' by providing a live \ - implementation of your dependency, and make sure that the conformance is linked with \ - this current application. + * Conform 'TestKey' to the 'DependencyKey' protocol by providing a live implementation \ + of your dependency, and make sure that the conformance is linked with this current \ + application. + + * Override the implementation of 'TestKey' using 'withDependencies'. This is typically \ + done at the entry point of your application, but can be done later too. """ } #endif @@ -71,12 +73,14 @@ final class DependencyValuesTests: XCTestCase { Value: Int - Every dependency registered with the library must conform to 'DependencyKey', and that \ - conformance must be visible to the running application. + To fix you can do one of two things: + + * Conform 'TestKey' to the 'DependencyKey' protocol by providing a live implementation \ + of your dependency, and make sure that the conformance is linked with this current \ + application. - To fix, make sure that 'TestKey' conforms to 'DependencyKey' by providing a live \ - implementation of your dependency, and make sure that the conformance is linked with \ - this current application. + * Override the implementation of 'TestKey' using 'withDependencies'. This is typically \ + done at the entry point of your application, but can be done later too. """ } #endif