tschneidereit / SwiftSuspenders

NOTE: Find the offical repo at http://github.com/robotlegs/swiftsuspenders
https://github.com/robotlegs/swiftsuspenders
MIT License
280 stars 89 forks source link

Asymmetry between satisfies & satisfiesDirectly #73

Closed Stray closed 11 years ago

Stray commented 11 years ago

_injector.satisfiesDirectly(UnmappedClass) -> false

_injector.satisfies(UnmappedClass) -> true

I understood that 'Directly' meant "without referring to ancestors". The current behaviour is rather confusing :)

It actually prevents sensible usage of _"Is this mapped, you can check with your parents and so on - I just want to know if I need to map it?"__ conditions in code.

Use case: lazy instantiation of viewProcessors for the viewProcessorMap. I need to check whether the mapping exists at all, before creating a new processor. I don't care whether it's direct or via ancestors, and in some cases the type will be a class, not an interface.

Thx

tschneidereit commented 11 years ago

So this is fallout from the decision to automatically instantiate unmapped classes. I think I even did this deliberately, which only reiterates how little I really thought this entire mess through.

I will verify, but this will most likely just go away once I revert the mentioned change.

tschneidereit commented 11 years ago

Fixed by a9344e245e and the commits by Stray before that.