Class BlockType
java.lang.Object
gw.lang.reflect.AbstractType
gw.lang.reflect.FunctionType
gw.internal.gosu.parser.expressions.BlockType
- All Implemented Interfaces:
IBlockType,IFunctionType,IGenericMethodInfo,IInvocableType,INonLoadableType,IType,Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]private IExpression[]private Stringprivate StringFields inherited from class gw.lang.reflect.FunctionType
_allTypesInHierarchyFields inherited from interface gw.lang.reflect.IType
EMPTY_ARRAY, EMPTY_TYPE_ARRAY, EMPTY_TYPE_LIST -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBlockType(FunctionType source, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars, List<String> argNames, List<IExpression> defValues) BlockType(IType returnType, IType[] iIntrinsicTypes, String[] argNames, IExpression[] defValues) BlockType(IType returnType, IType[] iIntrinsicTypes, List<String> argNames, List<IExpression> defValues) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected voidcopyFields(FunctionType source) booleangetName()The fully qualified name of this intrinsic type.String[]The relative or unqualified name.getRelativeParamSignature(boolean bSansBlock) booleannewInstance(IType[] paramTypes, IType returnType) parameterize(FunctionType source, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars) Create a new FunctionType based on the type parameters assigned to the type vars in actualParamByVarName.Methods inherited from class gw.lang.reflect.FunctionType
areEnclosingTypesEqual, areParamsCompatible, areParamsCompatible, areSameTypes, findContravariantParams, getAllTypesInHierarchy, getArrayComponent, getArrayLength, getArrayType, getComponentType, getCompoundTypeComponents, getDisplayName, getEnclosingType, getGenericType, getGenericTypeVariables, getInterfaces, getIntrinsicType, getMethodInfo, getMethodOrConstructorInfo, getModifiers, getNamespace, getOwningParameterizedType, getParameterizedParameterTypes, getParameterizedParameterTypes2, getParameterizedReturnType, getParameterizedType, getParameterTypes, getParamSignature, getParamSignatureForCurrentModule, getParamTypeNameFromJavaBackedType, getReturnType, getRuntimeType, getScriptPart, getSupertype, getTypeInfo, getTypeLoader, getTypeParameters, getTypeVariables, hashCode, inferParameterizedTypeFromArgTypesAndContextType, inferTypeParametersFromArgumentTypes, inferTypeParametersFromArgumentTypes2, isAbstract, isArray, isAssignableFrom, isAssignableFrom, isCompoundType, isDiscarded, isEnum, isFinal, isGenericType, isInterface, isMutable, isParameterizedType, isPrimitive, isValid, makeArrayInstance, readResolve, setArgumentTypes, setArrayComponent, setDiscarded, setEnclosingType, setModifiers, setRetType, setScriptPart, toString, unloadTypeInfoMethods inherited from class gw.lang.reflect.AbstractType
getLiteralMetaType, getMetaType, getTheRefMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface gw.lang.reflect.IFunctionType
areParamsCompatible, getMethodInfo, getMethodOrConstructorInfo, getParameterTypes, getParamSignature, getParamSignatureForCurrentModule, getReturnType, getScriptPart, inferParameterizedTypeFromArgTypesAndContextType, isAssignableFromMethods inherited from interface gw.lang.reflect.IGenericMethodInfo
getParameterizedParameterTypes, getParameterizedParameterTypes2, getParameterizedReturnType, getTypeVariables, inferTypeParametersFromArgumentTypes, inferTypeParametersFromArgumentTypes2Methods inherited from interface gw.lang.reflect.IType
compile, getAllTypesInHierarchy, getArrayComponent, getArrayLength, getArrayType, getComponentType, getCompoundTypeComponents, getDisplayName, getEnclosingType, getFunctionalInterface, getGenericType, getGenericTypeVariables, getInterfaces, getLiteralMetaType, getMetaType, getModifiers, getNamespace, getParameterizedType, getSourceFiles, getSupertype, getTypeInfo, getTypeLoader, getTypeParameters, isAbstract, isArray, isAssignableFrom, isCompilable, isCompoundType, isDiscarded, isDynamic, isEnum, isFinal, isGenericType, isInterface, isMutable, isParameterizedType, isPrimitive, isValid, makeArrayInstance, readResolve, setArrayComponent, setDiscarded, unloadTypeInfo
-
Field Details
-
_relativeSignature
-
_relativeSignatureSansBlock
-
_argNames
-
_defValues
-
-
Constructor Details
-
BlockType
-
BlockType
public BlockType(IType returnType, IType[] iIntrinsicTypes, String[] argNames, IExpression[] defValues) -
BlockType
private BlockType(FunctionType source, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars, List<String> argNames, List<IExpression> defValues)
-
-
Method Details
-
copyFields
- Overrides:
copyFieldsin classFunctionType
-
parameterize
public FunctionType parameterize(FunctionType source, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars) Description copied from class:FunctionTypeCreate a new FunctionType based on the type parameters assigned to the type vars in actualParamByVarName.It is important to note that this form of parameterization is different from calling getParameterizedType(). The latter creates a parameterization of a generic function e.g., function foo<T>() where T is a type var on the function.
This here method is for parameterizing a function type that has references to external type vars e.g., class Fred<T> { function foo( t : T ){} } where T is a type var on the containing class.
- Overrides:
parameterizein classFunctionType- Parameters:
source- The raw form of a FunctionType having possible references to type vars defined in its containing class.actualParamByVarName- A map of concrete types by type var name e.g., "T" -> StringbKeepTypeVars- Indicates whether or not a type var referenced in the source FunctionType that cannot be resolved via the actualParamByVarName map should remain as a TypeVariableType or should be converted to its bounding type.- Returns:
- A parameterized version of the source FunctionType
-
getName
Description copied from interface:ITypeThe fully qualified name of this intrinsic type.- Specified by:
getNamein interfaceIType- Overrides:
getNamein classFunctionType
-
getRelativeName
Description copied from interface:ITypeThe relative or unqualified name. For a class this should be just the class name without the package name.- Specified by:
getRelativeNamein interfaceIType- Overrides:
getRelativeNamein classFunctionType
-
getRelativeNameSansBlock
- Specified by:
getRelativeNameSansBlockin interfaceIBlockType
-
getRelativeParamSignature
- Specified by:
getRelativeParamSignaturein interfaceIBlockType
-
getParameterNames
- Specified by:
getParameterNamesin interfaceIInvocableType- Overrides:
getParameterNamesin classFunctionType
-
areReturnTypesAssignable
- Overrides:
areReturnTypesAssignablein classFunctionType
-
equals
- Overrides:
equalsin classFunctionType
-
getDefaultValueExpressions
- Specified by:
getDefaultValueExpressionsin interfaceIInvocableType- Overrides:
getDefaultValueExpressionsin classFunctionType
-
hasOptionalParams
public boolean hasOptionalParams()- Specified by:
hasOptionalParamsin interfaceIInvocableType- Overrides:
hasOptionalParamsin classFunctionType
-
newInstance
- Specified by:
newInstancein interfaceIFunctionType- Overrides:
newInstancein classFunctionType- Returns:
- a new copy of this IFunctionType with the given parameter and return types
-