This is the contrapositive of the theorem: if \(f\) were holomorphic on \(D\), every closed integral would be \(0\). A primitive would also force it to be \(0\).
The Cauchy-Goursat theorem says that, if \(f\) is holomorphic on a simply connected open set \(D\), its integral over any closed contour \(C\) contained in \(D\) is zero.