locate(tag or ref)
and
locate(type) in list
Are not compatible.

I've already said this.