Let $\iota\colon X\to \Omega\subseteq \mathbb{C}^n$ be a complex analytic variety $X$ in an open subset $\Omega$ of $\mathbb{C}^n$. If $N$ is a smooth manifold and $h\colon M\to X$ is a continuous map, then I call $h$ smooth if $\iota\circ h$ is smooth.
Suppose that $f\colon X\to \mathbb{C}$ is continuous and for every smooth map $g\colon M\to X$, from a smooth manifold $M$, the composition $f\circ g \colon M \to \mathbb{C}$ is smooth. Does it follow that $f$ is smooth, by which I mean, there exists a smooth function in an open neighbourhood of $X$ that restricts to $f$?
I know that at the non-singular points of $X$ the function $f$ is smooth by the result, that functions on smooth manifolds, that are smooth when composed with any smooth curves are necessarily smooth.
More concretely, I am interested in the case where $f$ is a continuous weak holomorphic function, which is smooth after composition with any smooth curve.