private IFunctionType boundFunctionType( IFunctionType funcType ) { if( funcType.isGenericType() ) { IGenericTypeVariable[] typeVariables = funcType.getGenericTypeVariables(); List<IType> functionTypeVars = new ArrayList<>(); addTypeVarsToList( functionTypeVars, typeVariables ); return (IFunctionType)TypeLord.boundTypes( funcType, functionTypeVars ); } else { return funcType; } }
private IFunctionType boundFunctionType( IFunctionType funcType ) { if( funcType.isGenericType() ) { IGenericTypeVariable[] typeVariables = funcType.getGenericTypeVariables(); List<IType> functionTypeVars = new ArrayList<IType>(); for( IGenericTypeVariable typeVariable : typeVariables ) { ITypeVariableDefinition typeVariableDefinition = typeVariable.getTypeVariableDefinition(); if( typeVariableDefinition != null && typeVariableDefinition.getType() != null ) { functionTypeVars.add( typeVariableDefinition.getType() ); } } return (IFunctionType)TypeLord.boundTypes( funcType, functionTypeVars ); } else { return funcType; } }
protected void pushInferredFunctionTypeVariableTypes( List<IFunctionType> listFunctionTypes ) { List<IType> typeVariableTypes = new ArrayList<IType>(); for( IFunctionType functionType : listFunctionTypes ) { if( functionType.isGenericType() && (getEnclosingType() == null || !getEnclosingType().equals( functionType )) ) { IGenericTypeVariable[] typeVariables = functionType.getGenericTypeVariables(); for( IGenericTypeVariable typeVariable : typeVariables ) { ITypeVariableDefinition typeVariableDefinition = typeVariable.getTypeVariableDefinition(); if( typeVariableDefinition != null && typeVariableDefinition.getType() != null ) { typeVariableTypes.add( typeVariableDefinition.getType() ); } } } } pushInferredTypeVars( typeVariableTypes ); }
private void addFunctionTypeParams( IFunctionType functionType, List<IRType> params ) { if (functionType == null) { return; } if( functionType.isParameterizedType() ) { addTypeVariableParameters( params, functionType.getTypeParameters().length ); } else if( functionType.isGenericType() ) { addTypeVariableParameters( params, functionType.getGenericTypeVariables().length ); } }
private IFunctionType getDelegateFunctionType( DelegateFunctionSymbol delegateSymbol ) { IFunctionType functionType = new FunctionType( delegateSymbol.getMi() ); if( !functionType.isGenericType() ) { return functionType; } // If the method is generic, we must parameterize the method call in order to forward the method's type params IGenericTypeVariable[] typeVariables = functionType.getGenericTypeVariables(); IType[] typeParams = new IType[typeVariables.length]; for( int i = 0; i < typeVariables.length; i++ ) { IGenericTypeVariable gtv = typeVariables[i]; typeParams[i] = gtv.getTypeVariableDefinition().getType(); } return (IFunctionType)functionType.getParameterizedType( typeParams ); }
private void addFunctionTypeParams( IFunctionType functionType, List<IRType> params ) { if( functionType == null || !Modifier.isReified( functionType.getModifiers() ) ) { return; } if( functionType.isParameterizedType() ) { addTypeVariableParameters( params, functionType.getTypeParameters().length ); } else if( functionType.isGenericType() ) { addTypeVariableParameters( params, functionType.getGenericTypeVariables().length ); } }
for( IGenericTypeVariable typeVariable : funcType.getGenericTypeVariables() )
for( IGenericTypeVariable typeVariable : funcType.getGenericTypeVariables() )
if( equivalentTypes( funcType.getScriptPart().getContainingType(), getGosuClass() ) ) IGenericTypeVariable[] genTypeVars = funcType.getGenericTypeVariables(); for( int i = 0; i < genTypeVars.length; i++ )
if( equivalentTypes( funcType.getScriptPart().getContainingType(), getGosuClass() ) ) IGenericTypeVariable[] genTypeVars = funcType.getGenericTypeVariables(); for( int i = 0; i < genTypeVars.length; i++ )