io.sarl.lang.typesystem
Interface ISARLTypeChecker
All Known Implementing Classes:
DefaultSARLTypeChecker
interface ISARLTypeChecker
SARL type checker that provides extended methods for checking types compared to the standard Xtext type checker.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.15
Action Summary
Modifier and type Action and description
abstract int getTypeArgumentConformance(List<E>,List<E>,ITypeReferenceOwner)
Replies the conformance of the to type parameters.
default boolean isTypeArgumentConformant(List<E>,List<E>,ITypeReferenceOwner)
Replies if the given type arguments are conform to the type parameters.
abstract java.util.List<E> substituteRootWildcard(List<E>,List<E>,ITypeReferenceOwner)
Substitute the root wildcards ? extends X by X.
Action Details
getTypeArgumentConformance(List<E>,List<E>,ITypeReferenceOwner)
def getTypeArgumentConformance(List<E>,List<E>,ITypeReferenceOwner) : int
Replies the conformance of the to type parameters.

The code of this function is adapted from the code of Xtext library. The Xtext library seems not treating the bounding constraint in the expected way: the original conformance flags are immediately returned when tested the bounds of a second-level type parameter. This leads always to incompatibility.
Parameters:
typeArguments - the list of type parameters that are passed as arguments.
typeParameters - the list of types parameters that have been declared.
referenceOwner - the owner of the type reference.
Returns:
the conformance.
Since:
0.15
See:
RawTypeConformanceComputer
isTypeArgumentConformant(List<E>,List<E>,ITypeReferenceOwner)
def isTypeArgumentConformant(List<E>,List<E>,ITypeReferenceOwner) : boolean
Replies if the given type arguments are conform to the type parameters.

The code of this function is adapted from the code of Xtext library.
Parameters:
typeArguments - the list of type parameters that are passed as arguments.
typeParameters - the list of types parameters that have been declared.
referenceOwner - the owner of the type reference.
Returns:
true if the type arguments and type parameters are conform.
substituteRootWildcard(List<E>,List<E>,ITypeReferenceOwner)
def substituteRootWildcard(List<E>,List<E>,ITypeReferenceOwner) : java.util.List<E>
Substitute the root wildcards ? extends X by X. If there is no root wildcard, the argument is replied as-is. If the wildcard is ? then it is substituted by the upper bound from the parameter declaration at the same index in the list of parameters; otherwise, Object is used as replacement. The wildcards that are defined as type arguments inside X are not substituted.
Parameters:
arguments - the arguments to change.
parameters - the parameters' declarations that are corresponding to the given arguments.
referenceOwner - the owner of the references that are created during the substitution.
Returns:
the result of the substitution.