I am reading a proof that any conformal map from upper half plane H to polygon P is a linear function of Schwarz-Christoffel integral.

In the proof the Schwarz reflection principle is applied to a situation where function is not real valued on the real line segment, but it maps this segment to a straight line in C.

Why can we apply a reflection principle here, which assumes that function must be real valued?