Conditional Expressions

Author: LGTM

import python
from IfExp e, ClassObject cls1, ClassObject cls2
where
 e.getBody().refersTo(_, cls1, ) and
 e.getOrelse().refersTo(, cls2, _) and
 cls1 != cls2
select e

Description

Finds conditional expressions of the form '... if ... else ...' where the classes of the sub-expressions differ