Predicate designedForChaining
Holds if callable c
is designed for chaining. The following must
be fulfilled:
c
must be declared in a reference type.- All callables overriding
c
must be designed for chaining. - If
c
has a body, all (and at least one) returned values must bethis
. - If
c
has no body (abstract/interface callable or library callable), the return type ofc
must be a subtype ofc
’s declaring type, andc
must be non-static.
Import path
import semmle.code.csharp.Chaining
predicate designedForChaining(Callable c)