WiseTechGlobal / WTG.Analyzers

Analyzers from WiseTech Global to enforce our styles, behaviours, and prevent common mistakes.
Other
15 stars 3 forks source link

Fix WTG1002 false-positive in enumerable subclasses #214

Closed yaakov-h closed 1 year ago

yaakov-h commented 1 year ago

This comes from the case discussed in Teams.

When a foreach-able object is invoked via a subclass, we don't necessarily locate the correct GetEnumerator method. This PR fixes EnumerableTypeUtils.GetElementType to check the base classes as well.

Tracked by WI00633703.