Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Concrete implementations should be private #2704
By default, the VBE makes interface member implementations (/event handlers)
We need an inspection that finds
The catch is that doing that might break callers if the callers are written against the concrete type, so the inspection's meta description should mention that.
On that note: We should flag such direct callers in another inspection. "Explicit call to interface member on concrete class instance" seems like a good idea. The quickfix would then declare the accessed variable
For instances where both call types are intermingled, we could have another related inspection (but that might be asking too much).
@Vogel612 we know which interface(s) the concrete class is implementing, so there could be a quick-fix for changing the declaration to either. e.g. "Declare As ISomething" and "Declare As ISomethingElse", assuming the concrete type implements both
Hmm.. that feels like R#'s "(thing) can be declared as (interface)"...