appsquickly / typhoon

Powerful dependency injection for Objective-C ✨✨ (https://PILGRIM.PH is the pure Swift successor to Typhoon!!)✨✨
https://pilgrim.ph
Apache License 2.0
2.7k stars 270 forks source link

Creating a collaborating assembly called 'assembly' causes crashes #570

Open jasperblues opened 6 years ago

jasperblues commented 6 years ago

Steps to repro:

In header:

@property (strong, nonatomic, readonly) ApplicationAssembly *assembly; 

In impl:

- (ProfilePreviewHelper *)profilePreviewHelper
{
    return [TyphoonDefinition withClass:[ProfilePreviewHelper class] configuration:^(TyphoonDefinition *definition) {
        [definition injectProperty:@selector(assembly)];
        [definition injectProperty:@selector(profileService)];
        [definition injectProperty:@selector(rootController) with:[self.assembly rootController]];
        [definition injectProperty:@selector(candidatesService)];
        definition.scope = TyphoonScopeWeakSingleton;
    }];
}