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

The following examples show how to use com.sun.tools.javac.code.Type#contains() . 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: StructuralTypeEraser.java    From manifold with Apache License 2.0 6 votes vote down vote up
private Type eraseBound( Type t, Type bound )
{
  if( bound == null || bound instanceof NoType )
  {
    return bound;
  }

  Type erasedBound;
  if( bound.contains( t ) )
  {
    erasedBound = visit( _types.erasure( bound ) );
  }
  else
  {
    erasedBound = visit( bound );
  }
  return erasedBound;
}
 
Example 2
Source File: InferenceContext.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Returns a list of free variables in a given type
 */
final List<Type> freeVarsIn(Type t) {
    ListBuffer<Type> buf = new ListBuffer<>();
    for (Type iv : inferenceVars()) {
        if (t.contains(iv)) {
            buf.add(iv);
        }
    }
    return buf.toList();
}
 
Example 3
Source File: InferenceContext.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a list of free variables in a given type
 */
final List<Type> freeVarsIn(Type t) {
    ListBuffer<Type> buf = new ListBuffer<>();
    for (Type iv : inferenceVars()) {
        if (t.contains(iv)) {
            buf.add(iv);
        }
    }
    return buf.toList();
}