Closed bdovaz closed 2 weeks ago
cc @jbevain
You are right. But this is the typical case of generics where we cannot use type-constraints provided directly for GetComponent<T>
and where we should infer effective type based on the usage: Test<IMyInterface>
. This is not what we are doing for now (for simplicity and performance).
So, for consistency, I refactored the diagnostic with the following rule:
Bug description
In the documentation of this rule it clearly states that if you pass an interface it will not fail and it is so, but if you do it with generics it will fail.
To Reproduce
Expected behavior
It should not report a problem.