Package org.ek9lang.compiler.symbols
Interface ICanBeGeneric
- All Superinterfaces:
ISymbol
,ITokenReference
,Serializable
- All Known Subinterfaces:
IAggregateSymbol
- All Known Implementing Classes:
AggregateSymbol
,AggregateWithTraitsSymbol
,FunctionSymbol
,PossibleGenericSymbol
Really a Marker interface for generic classes and generic functions.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ek9lang.compiler.symbols.ISymbol
ISymbol.SymbolCategory, ISymbol.SymbolGenus
-
Field Summary
Fields inherited from interface org.ek9lang.compiler.symbols.ISymbol
NOT_ASSIGNABLE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addGenericSymbolReference
(PossibleGenericSymbol genericSymbolReference) Provides a mechanism to record 'dependent generic types'.void
addTypeParameterOrArgument
(ISymbol typeParameterOrArgument) Used to keep track of any generic types/functions used in a generic type that use some or all of the generic type parameters or arguments.Not only can a class/function that implements this interface be generic in nature, they can also be a 'parameterised type'.boolean
Is the symbol open for extension or not.Methods inherited from interface org.ek9lang.compiler.symbols.ISymbol
clearInitialisedBy, clone, getAssignableWeightTo, getAssignableWeightTo, getCategory, getFriendlyName, getFullyQualifiedName, getGenus, getInitialisedBy, getName, getParsedModule, getSourceToken, getSquirrelledData, getType, getUnCoercedAssignableWeightTo, isApplication, isAssignableTo, isAssignableTo, isConceptualTypeParameter, isConstant, isControl, isDeclaredAsConstant, isDevSource, isEk9Core, isExactSameType, isExtensionOfInjectable, isFromLiteral, isFunction, isGenericInNature, isIncomingParameter, isInitialised, isInjectable, isInjectionExpected, isLibSource, isLoopVariable, isMarkedAbstract, isMarkedPure, isMethod, isMutable, isNullAllowed, isParameterisedType, isPrimitiveType, isPrivate, isPromotionSupported, isPropertyField, isProtected, isPublic, isReferenced, isReturningParameter, isTemplateFunction, isTemplateType, isType, isVariable, putSquirrelledData, setGenus, setInitialisedBy, setInjectionExpected, setName, setNotMutable, setNullAllowed, setParsedModule, setReferenced, setType, setType
Methods inherited from interface org.ek9lang.compiler.symbols.ITokenReference
setSourceToken
-
Method Details
-
getGenericType
Optional<PossibleGenericSymbol> getGenericType()Not only can a class/function that implements this interface be generic in nature, they can also be a 'parameterised type'. -
getGenericSymbolReferences
List<PossibleGenericSymbol> getGenericSymbolReferences()Used to keep track of any generic types/functions used in a generic type that use some or all of the generic type parameters or arguments. For example a 'List of type T' might use or return an 'Iterator of type T'. It is the 'Iterator' that would be a generic symbol reference. -
addGenericSymbolReference
Provides a mechanism to record 'dependent generic types'. See above wrt 'List of T' and 'Iterator of T'. The reason for keeping these references is to that when the main generic type is 'paramterized' we can 'cascade' that parameterization through to all dependent types. This means when 'List of type T' is parameterized with 'T' -> 'Integer', we can also do that for 'Iterator of type T', meaning we get a 'Iterator of Integer' even though we only asked for a 'List of Integer'. You can see where this is taking us! Gigantic cascades of parameterized types. This means the EK9 developer can get loads of 'types for free' i.e. without needing to be explicit. -
addTypeParameterOrArgument
-
getAnyConceptualTypeParameters
-
getTypeParameterOrArguments
-
isOpenForExtension
boolean isOpenForExtension()Is the symbol open for extension or not. Typically this means a function is open/abstract and therefore can/must be extended. The same with classes and components.
-