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 |
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:TypeInfo | Undocumented |
supertype:TypeInfo | Undocumented |
Returns | |
List[ | Undocumented |
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:Instance | Undocumented |
Returns | |
Dict[ | Undocumented |
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:Instance | Undocumented |
superclass:TypeInfo | Undocumented |
Returns | |
Instance | Undocumented |