Material function conundrum

I have the following material function which produces a vector3 to be used as world position offset.
Now, it won’t compile unless there is that VertexInterpolator node. But if it’s there then the material, where the function is actually used, breaks, because that VertexInterpolator node shouldn’t be there in the vertex shader…

How could I work around this?

You do not need vertex interpolator material expression there, as world position offset is aleady evaluated in vertex shader.

As I said, the function won’t compile unless the VertexInterpolator node is there.