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
Merge pull request #26 from strvcom/dc/feat/debug-improvements
Improve DI debugging by replacing ObjectIdentifier(...) in ResolutionError messages with readable Swift type names, and document that argument matching uses compile-time types.
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,20 @@ container.register { container, number in
86
86
}
87
87
```
88
88
89
+
Argument matching is based on the compile-time type of each argument. That means `ConcreteType` and `any SomeProtocol` are different registrations even if the concrete value conforms to the protocol:
90
+
```swift
91
+
let container =Container()
92
+
container.register { _, dependency:any DIProtocol in
/// - argumentTypes: Variadic argument types using parameter packs. Only 1-3 arguments are supported. Entering more arguments will cause error in runtime.
0 commit comments