MWE:
# Does not error
mean(rand(X(10)); dims=:foo)
# Does not error
sum(rand(X(10)); dims=:foo)
# Does error with 'ArgumentError: (X,) dims were not found in object'
std(rand(X(10)); dims=:foo)
I did not audit all of the methods to check their behaviour. I think DD should always throw an error if an invalid dimension name is passed.