public DimensionCalc compileDimension(Exp exp) {
final Type type = exp.getType();
if (type instanceof HierarchyType) {
final HierarchyCalc hierarchyCalc = compileHierarchy(exp);
return new HierarchyDimensionFunDef.CalcImpl(
new DummyExp(new DimensionType(type.getDimension())),
hierarchyCalc);
}
assert type instanceof DimensionType : type;
return (DimensionCalc) compile(exp);
}