Java Code Examples for com.sun.tools.javac.code.Type#filter()

The following examples show how to use com.sun.tools.javac.code.Type#filter() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Infer.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Make sure that the upper bounds we got so far lead to a solvable inference
 * variable by making sure that a glb exists.
 */
void checkCompatibleUpperBounds(UndetVar uv, InferenceContext inferenceContext) {
    List<Type> hibounds =
            Type.filter(uv.getBounds(InferenceBound.UPPER), new BoundFilter(inferenceContext));
    final Type hb;
    if (hibounds.isEmpty())
        hb = syms.objectType;
    else if (hibounds.tail.isEmpty())
        hb = hibounds.head;
    else
        hb = types.glb(hibounds);
    if (hb == null || hb.isErroneous())
        reportBoundError(uv, InferenceBound.UPPER);
}
 
Example 2
Source File: Infer.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * Return the subset of ground bounds in a given bound set (i.e. eq/lower/upper)
 */
List<Type> filterBounds(UndetVar uv, InferenceContext inferenceContext) {
    return Type.filter(uv.getBounds(ib), new BoundFilter(inferenceContext));
}