public TypeMirror getType(Type t) {
        if (t.isPrimitive()) {
            return primTypes[t.tag];
        }
        switch (t.tag) {
        case ERROR:     // fall through
        case CLASS:     return getDeclaredType((Type.ClassType) t);
        case WILDCARD:  return new WildcardTypeImpl(env, (Type.WildcardType) t);
        case TYPEVAR:   return new TypeVariableImpl(env, (Type.TypeVar) t);
        case ARRAY:     return new ArrayTypeImpl(env, (Type.ArrayType) t);
        case VOID:      return voidType;
        default:        throw new AssertionError();
        }
    }