Whether dim is compatible with this dimension.
dim
bool isCompatible(Dimension dim) => dim._def.toString() == _def.toString();