3 ms·
This code wouldn't compile, for starters. But it could be `IValidator<object>`, in the worst case. That being said, why not make a `class ThingValidator<T> : I
by yumaikas 9y ago
This code wouldn't compile, for starters.
But it could be `IValidator<object>`, in the worst case. That being said, why not make a `class ThingValidator<T> : IValidator<T> {}`, for all the lack of detail we have?
There aren't enough details here to demonstrate the weaknesses of generics.
- sharpercoder 9y ago>This code wouldn't compile, for starters. Thats the point. You need an `IValidator` interface.
- yumaikas 9y agoThe reason it won't compile is that the code, as given, has two classes with the same name.