if (clasz.isModuleClass()) { Type prefix = clasz.owner().thisType(); return Type.singleType(apply(prefix), clasz.module()); }
        public Type apply(Type type) {            switch (type) {            case TypeRef(Type prefix, Symbol symbol, Type[] args):                if (symbol.isParameter() && symbol.owner().isConstructor()) {                    assert prefix.equals(Type.localThisType): type;                    assert args.length == 0: type;                    Object value = tparams.get(symbol);                    return value != null ? (Type)value : type;                }                if (symbol.isClass()) {                    args = map(getNewArgsOf(context, prefix, symbol, args));                    prefix = Type.localThisType;                    return Type.typeRef(prefix, symbol, args);                }                if (symbol.isPackage()) {                    args = Type.EMPTY_ARRAY;                    prefix = Type.localThisType;                    return Type.typeRef(prefix, symbol, args);                }                return Type.typeRef(apply(prefix), symbol, map(args));            case SingleType(Type prefix, Symbol symbol):                return Type.singleType(apply(prefix), symbol);            case ThisType(Symbol clasz):                if (clasz == Symbol.NONE) return type;                if (clasz == context.clasz) return type;                if (clasz.isPackage()) return Type.localThisType;                for (int i = 0; i < context.outers.length; i++)                    if (clasz == context.outers[i].clasz)                        return context.getTypeLink(i);                if (clasz.isModuleClass()) {                    Type prefix = clasz.owner().thisType();                    return Type.singleType(apply(prefix), clasz.module());                }                throw Debug.abort("illegal ThisType", type);            case CompoundType(Type[] parents, Scope members):                // !!! this case should not be needed                return Type.compoundType(map(parents), members, type.symbol());            default:                return map(type);            }        }