vs-mef
vs-mef copied to clipboard
Analyzer could detect duplicate imports
I found a MEF part today that imported the same object via two constructor parameters, but with different names.
The same is possible for ~parameter~ property injection.
While harmless, it's a little messy and may lead to confusion. An analyzer could detect this.
The same is possible for parameter injection.
I don't understand this bit. What is parameter injection if it isn't involving an importing constructor?
Another variant on this would be an importing property and an equivalent importing constructor parameter, or just two equivalent importing properties.
Strictly speaking, an exporting member may produce unique values each time it is pulled from, so two "identical" imports may in fact be valuable to the consumer in getting two unique instances. However this is by far a very niche case, so an analyzer to catch what would commonly be a (minor) bug or at least a cosmetic anomaly may be useful.
My sense though is this is a low priority as it seems unlikely to result in a bug.