I wonder if the following statement is true. Or under what kind of condition this could be true?
Suppose $M$ is a compact Riemann surface. $E$ is a complex vector bundle on $M$ admitting a flat connection. Then $M$ is trivial as a complex vector bundle.
All objects above are assumed to be $C^\infty$.