/** * @return The instrinic type of this FunctionType's return type. */ public IType getIntrinsicType() { return getReturnType(); }
/** * @return The instrinic type of this FunctionType's return type. */ public IType getIntrinsicType() { return getReturnType(); }
private void assignReturnTypeFromTypeParams( FunctionType source, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars ) { _retType = TypeSystem.getActualType( source.getReturnType(), actualParamByVarName, bKeepTypeVars ); if( _retType == null ) { _retType = source.getReturnType(); } if (_retType == null) { _retType = JavaTypes.pVOID(); } }
private void assignReturnTypeFromTypeParams( FunctionType source, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars ) { _retType = TypeSystem.getActualType( source.getReturnType(), actualParamByVarName, bKeepTypeVars ); if( _retType == null ) { _retType = source.getReturnType(); } if (_retType == null) { _retType = JavaTypes.pVOID(); } }
public IType getReturnType() { return ((FunctionType)getType()).getReturnType(); }
public String toString() { return getParamSignature().toString() + ":" + getReturnType().getName(); }
public String toString() { return getParamSignature().toString() + ":" + getReturnType().getName(); }
private boolean isParsingConstructor() { if( !isParsingFunction() ) { return false; } FunctionType funcType = peekParsingFunction(); return funcType.getReturnType() == getGosuClass() && funcType.getName().equals( funcType.getReturnType().getRelativeName() ); }
private boolean isParsingConstructor() { if( !isParsingFunction() ) { return false; } FunctionType funcType = peekParsingFunction(); return funcType.getReturnType() == getGosuClass() && funcType.getName().equals( funcType.getReturnType().getRelativeName() ); }
protected boolean areReturnTypesAssignable( FunctionType from ) { IType toType = getReturnType(); IType fromType = from.getReturnType(); if( isThisReturnTypeNotVoidThatReturnTypeVoid( toType, fromType ) ) { return false; } return toType == fromType || toType.isAssignableFrom( fromType ) || StandardCoercionManager.isStructurallyAssignable( toType, fromType ) || StandardCoercionManager.arePrimitiveTypesAssignable( toType, fromType ) || toType == GosuParserTypes.NULL_TYPE(); }
private IType useDynamicTypeIfDynamicRoot( IInvocableType funcType, IType ctxType ) { if( funcType instanceof FunctionType && ((FunctionType)funcType).getMethodInfo() != null ) { IMethodInfo mi = ((FunctionType)funcType).getMethodInfo(); if( mi.getOwnersType().isDynamic() ) { ctxType = ((FunctionType)funcType).getReturnType(); } } return ctxType; }
@Override protected boolean areReturnTypesAssignable( FunctionType that ) { IType thisType = getReturnType(); IType thatType = that.getReturnType(); return thisType == thatType || thatType != JavaTypes.pVOID() && thisType.isAssignableFrom( thatType ) || StandardCoercionManager.arePrimitiveTypesAssignable( thisType, thatType ); }
public String getMethodSignature() { return getDisplayName() + getParameterDisplay( true ) + " : " + TypeInfoUtil.getTypeName( ((FunctionType)getType()).getReturnType() ); }
public String getMethodSignature() { return getDisplayName() + getParameterDisplay( true ) + " : " + TypeInfoUtil.getTypeName( ((FunctionType)getType()).getReturnType() ); }
private IJavaClassInfo getFunctionClass() { return TypeSystem.getGosuClassLoader().getFunctionClassForArity( getReturnType() != JavaTypes.pVOID(), getParameterTypes().length ).getBackingClassInfo(); }
public IType getParameterizedReturnType( IType... typeParams ) { TypeVarToTypeMap actualParamByVarName = new TypeVarToTypeMap(); int i = 0; for( IGenericTypeVariable tv : getTypeVariables() ) { actualParamByVarName.put( tv.getTypeVariableDefinition().getType(), typeParams[i++] ); } return TypeSystem.getActualType( getReturnType(), actualParamByVarName, false ); }
public IType getParameterizedReturnType( IType... typeParams ) { TypeVarToTypeMap actualParamByVarName = new TypeVarToTypeMap(); int i = 0; for( IGenericTypeVariable tv : getTypeVariables() ) { actualParamByVarName.put( tv.getTypeVariableDefinition().getType(), typeParams[i++] ); } return TypeSystem.getActualType( getReturnType(), actualParamByVarName, false ); }
public FunctionType getRuntimeType() { TypeVarToTypeMap actualParamByVarName = new TypeVarToTypeMap(); actualParamByVarName = mapTypes( actualParamByVarName, getParameterTypes() ); actualParamByVarName = mapTypes( actualParamByVarName, getReturnType() ); return actualParamByVarName.size() != 0 ? parameterize( this, actualParamByVarName, false ) : this; }
public IType getRuntimeType() { TypeVarToTypeMap actualParamByVarName = new TypeVarToTypeMap(); actualParamByVarName = mapTypes( actualParamByVarName, getParameterTypes() ); actualParamByVarName = mapTypes( actualParamByVarName, getReturnType() ); return actualParamByVarName.size() != 0 ? parameterize( this, actualParamByVarName, false ) : this; }
public IType getParameterizedReturnType( IType... typeParams ) { TypeVarToTypeMap actualParamByVarName = TypeLord.mapTypeByVarName( getOwnersType(), getOwnersType() ); int i = 0; for( IGenericTypeVariable tv : getTypeVariables() ) { if( actualParamByVarName.isEmpty() ) { actualParamByVarName = new TypeVarToTypeMap(); } actualParamByVarName.put( tv.getTypeVariableDefinition().getType(), typeParams[i++] ); } return TypeLord.getActualType( ((FunctionType)getDfs().getType()).getReturnType(), actualParamByVarName, true ); }