hmlongco / Factory

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

WeakLazyInjected for AnyObject only #82

Closed lvalenta closed 1 year ago

lvalenta commented 1 year ago

I suggest making changes to implementation of WekLazyInjected where the compiler checks whether the provided dependency (T) is AnyObject. We can then avoid runtime typecasting

hmlongco commented 1 year ago

Not merging as it breaks the WeakLazyInjected test code.

lvalenta commented 1 year ago

Will look at it