  We extend the scope of a recently introduced dependence coefficient between a
scalar response $Y$ and a multivariate covariate $X$ to the case where $X$
takes values in a general metric space. Particular attention is paid to the
case where $X$ is a curve. While on the population level, this extension is
straight forward, the asymptotic behavior of the estimator we consider is
delicate. It crucially depends on the nearest neighbor structure of the
infinite-dimensional covariate sample, where deterministic bounds on the
degrees of the nearest neighbor graphs available in multivariate settings do no
longer exist. The main contribution of this paper is to give some insight into
this matter and to advise a way how to overcome the problem for our purposes.
As an important application of our results, we consider an independence test.
