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 String
private String
Fields inherited from class gw.lang.reflect.FunctionType
_allTypesInHierarchy
Fields inherited from interface gw.lang.reflect.IType
EMPTY_ARRAY, EMPTY_TYPE_ARRAY, EMPTY_TYPE_LIST
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
BlockType
(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 boolean
protected void
copyFields
(FunctionType source) boolean
getName()
The fully qualified name of this intrinsic type.String[]
The relative or unqualified name.getRelativeParamSignature
(boolean bSansBlock) boolean
newInstance
(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, unloadTypeInfo
Methods inherited from class gw.lang.reflect.AbstractType
getLiteralMetaType, getMetaType, getTheRef
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface gw.lang.reflect.IFunctionType
areParamsCompatible, getMethodInfo, getMethodOrConstructorInfo, getParameterTypes, getParamSignature, getParamSignatureForCurrentModule, getReturnType, getScriptPart, inferParameterizedTypeFromArgTypesAndContextType, isAssignableFrom
Methods inherited from interface gw.lang.reflect.IGenericMethodInfo
getParameterizedParameterTypes, getParameterizedParameterTypes2, getParameterizedReturnType, getTypeVariables, inferTypeParametersFromArgumentTypes, inferTypeParametersFromArgumentTypes2
Methods 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:
copyFields
in classFunctionType
-
parameterize
public FunctionType parameterize(FunctionType source, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars) Description copied from class:FunctionType
Create 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:
parameterize
in 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:IType
The fully qualified name of this intrinsic type.- Specified by:
getName
in interfaceIType
- Overrides:
getName
in classFunctionType
-
getRelativeName
Description copied from interface:IType
The relative or unqualified name. For a class this should be just the class name without the package name.- Specified by:
getRelativeName
in interfaceIType
- Overrides:
getRelativeName
in classFunctionType
-
getRelativeNameSansBlock
- Specified by:
getRelativeNameSansBlock
in interfaceIBlockType
-
getRelativeParamSignature
- Specified by:
getRelativeParamSignature
in interfaceIBlockType
-
getParameterNames
- Specified by:
getParameterNames
in interfaceIInvocableType
- Overrides:
getParameterNames
in classFunctionType
-
areReturnTypesAssignable
- Overrides:
areReturnTypesAssignable
in classFunctionType
-
equals
- Overrides:
equals
in classFunctionType
-
getDefaultValueExpressions
- Specified by:
getDefaultValueExpressions
in interfaceIInvocableType
- Overrides:
getDefaultValueExpressions
in classFunctionType
-
hasOptionalParams
public boolean hasOptionalParams()- Specified by:
hasOptionalParams
in interfaceIInvocableType
- Overrides:
hasOptionalParams
in classFunctionType
-
newInstance
- Specified by:
newInstance
in interfaceIFunctionType
- Overrides:
newInstance
in classFunctionType
- Returns:
- a new copy of this IFunctionType with the given parameter and return types
-