public static Type widerType(Type lh, Type rh) {

		int cmp = rh.compare(lh);
		if (cmp > 0) {
			if (lh == Type.nullType && rh instanceof PrimType) {
				return ((PrimType) rh).boxedType();
			} else {
				return rh;
			}
		} else if (cmp == 0) {
			if (rh instanceof ClassType) {
				return rh;
			}
			return lh;
		} else if (cmp == -1) {
			if (rh == Type.nullType && lh instanceof PrimType) {
				return ((PrimType) lh).boxedType();
			} else {
				return lh;
			}

		} else {
			Type ret = Type.lowestCommonSuperType(lh, rh);
			if (ret != null) {
				return ret;
			}
			return Type.objectType;
		}
	}