Weaver icon indicating copy to clipboard operation
Weaver copied to clipboard

Dependency container doesn't allow for overloaded make functions

Open StephaneMagne opened this issue 6 years ago • 0 comments

Currently this syntax:

    // weaver: annotationManager = AnnotationManagerV2 <- AnnotationManagingV2
    // weaver: annotationManager.scope = .transient
    // weaver: annotationManager.builder = SCApp.make

results in this code..

    var annotationManager: AnnotationManagingV2 {
        let value = SCApp.make(self)
        return value
    }

Which means that if a second make function were assigned to SCApp, it would be an ambiguous overloading error.

You can solve this by either making the code one line or adding in a strong value type for the variable value.

StephaneMagne avatar Jun 12 '19 21:06 StephaneMagne