class

TypeContext

Inherits CanError < ImplementationChecker < TypeUnifier < TypeEvaluator < Reference < Object

Type inference context

Constructors

new(env : TypeEnv, type_params : Slice(TypeParameter))
Source
new(env : TypeEnv, type_params : Slice(Ast::TypeParameter) | Nil = nil)
Source
new_with_constraints(env : TypeEnv, type_params : Slice(Ast::TypeParameter) | Nil) : TypeContext
Source

Instance methods

add_trait_bound(new_trait_bound : TraitBound)
Source
clone_with_type_args(type_args : Slice(Type))
Source
constraints_to_s(io : IO)
Source
implementations
Source
pretty_print(pp)
Source
process_constraints(ast_type_params : Slice(Ast::TypeParameter) | Nil) : TypeContext
Source
to_s(io : IO)

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
trait_bounds
Source
type_args
Source
type_args=(type_args : Slice(Type))
Source
type_params

getter generic : Generic # TypeDef | TraitDef | FunctionDef | TraitClaim

Source