module documentation
(source)

Undocumented

Function class​_derivation​_paths Return an array of non-empty paths of direct base classes from type to supertype. Return [] if no such path could be found.
Function instance​_to​_type​_environment Given an Instance, produce the resulting type environment for type variables bound by the Instance's class definition.
Function map​_instance​_to​_direct​_supertypes Undocumented
Function map​_instance​_to​_supertype Produce a supertype of instance that is an Instance of superclass, mapping type arguments up the chain of bases.
Function map​_instance​_to​_supertypes Undocumented
def class_derivation_paths(typ, supertype): (source)

Return an array of non-empty paths of direct base classes from type to supertype. Return [] if no such path could be found.

InterfaceImplementationPaths(A, B) == [[B]] if A inherits B InterfaceImplementationPaths(A, C) == [[B, C]] if A inherits B and

B inherits C
Parameters
typ:TypeInfoUndocumented
supertype:TypeInfoUndocumented
Returns
List[List[TypeInfo]]Undocumented
def instance_to_type_environment(instance): (source)

Given an Instance, produce the resulting type environment for type variables bound by the Instance's class definition.

An Instance is a type application of a class (a TypeInfo) to its required number of type arguments. So this environment consists of the class's type variables mapped to the Instance's actual arguments. The type variables are mapped by their id.

Parameters
instance:InstanceUndocumented
Returns
Dict[TypeVarId, Type]Undocumented
def map_instance_to_direct_supertypes(instance, supertype): (source)

Undocumented

Parameters
instance:InstanceUndocumented
supertype:TypeInfoUndocumented
Returns
List[Instance]Undocumented
def map_instance_to_supertype(instance, superclass): (source)

Produce a supertype of instance that is an Instance of superclass, mapping type arguments up the chain of bases.

If superclass is not a nominal superclass of instance.type, then all type arguments are mapped to 'Any'.

Parameters
instance:InstanceUndocumented
superclass:TypeInfoUndocumented
Returns
InstanceUndocumented
def map_instance_to_supertypes(instance, supertype): (source)

Undocumented

Parameters
instance:InstanceUndocumented
supertype:TypeInfoUndocumented
Returns
List[Instance]Undocumented