Package net.hydromatic.morel.compile
Class TypeMap
java.lang.Object
net.hydromatic.morel.compile.TypeMap
The result of type resolution, a map from AST nodes to types.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classVisitor that converts type terms into actual types. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<AstNode, Unifier.Term> (package private) final Unifier.Substitutionfinal TypeSystemMap from type variable name to type variable. -
Constructor Summary
ConstructorsConstructorDescriptionTypeMap(TypeSystem typeSystem, Map<AstNode, Unifier.Term> nodeTypeTerms, Unifier.Substitution substitution) -
Method Summary
Modifier and TypeMethodDescriptionReturns the type of an AST node.getTypeOpt(AstNode node) Returns the type of an AST node, or null if no type is known.booleanReturns whether an AST node has a type.(package private) TypetermToType(Unifier.Term term) toString()booleantypeIsVariable(AstNode node) Returns whether the type of an AST node will be a type variable.
-
Field Details
-
typeSystem
-
nodeTypeTerms
-
substitution
-
typeVars
Map from type variable name to type variable. The ordinal of the variable is the size of the map at the time it is registered.This map is never iterated over, and therefore the deterministic iteration provided by LinkedHashMap is not necessary, and HashMap is sufficient.
-
-
Constructor Details
-
TypeMap
TypeMap(TypeSystem typeSystem, Map<AstNode, Unifier.Term> nodeTypeTerms, Unifier.Substitution substitution)
-
-
Method Details
-
toString
-
termToType
-
getType
Returns the type of an AST node. -
getTypeOpt
Returns the type of an AST node, or null if no type is known. -
typeIsVariable
Returns whether the type of an AST node will be a type variable. -
hasType
Returns whether an AST node has a type.If it does not, perhaps it was ignored by the unification algorithm because it is not relevant to the program.
-