Java Code Examples for com.sun.tools.javac.code.Type#ForAll

The following examples show how to use com.sun.tools.javac.code.Type#ForAll . 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: JavacBinder.java    From manifold with Apache License 2.0 5 votes vote down vote up
private Type memberType( Type receiverType, Type argType, Symbol.MethodSymbol binderMethod )
{
  Type mt = _types.memberType( receiverType, binderMethod );
  if( mt instanceof Type.ForAll )
  {
    return resolveGenericReturnType( argType, (Type.ForAll)mt );
  }
  return mt.getReturnType();
}
 
Example 2
Source File: JavacBinder.java    From manifold with Apache License 2.0 5 votes vote down vote up
private Type resolveGenericReturnType( Type argType, Type.ForAll forAll )
{
  Type.MethodType mt = forAll.asMethodType();
  Type paramType = mt.getParameterTypes().get( 0 );
  paramType = paramType instanceof Type.TypeVar ? paramType.getUpperBound() : paramType;
  Type parameterizedParamType = _types.asSuper( argType, paramType.tsym );
  Map<Type.TypeVar, Type> map = new HashMap<>();
  fetchTypeVars( paramType, parameterizedParamType, map );
  return _types.subst( mt.getReturnType(),
    List.from( map.keySet() ),
    List.from( map.keySet().stream().map( k -> map.get( k ) ).collect( Collectors.toList() ) ) );
}
 
Example 3
Source File: JNIWriter.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public R visitForAll(Type.ForAll t, P p) {
    return defaultAction(t, p);
}
 
Example 4
Source File: JNIWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public R visitForAll(Type.ForAll t, P p) {
    return defaultAction(t, p);
}