module Cosmo::TypeChecker

Extended Modules

Defined in:

cosmo/runtime/typechecker.cr

Constant Summary

ALIASES = {} of String => String
REGISTERED = [] of Type
TYPE_MAP = {Int64 => "int", Int32 => "int", Int16 => "int", Int8 => "int", Float64 => "float", Float32 => "float", String => "string", Char => "char", Bool => "bool", Nil => "none", Function => "fn", PutsIntrinsic => "fn", Array(Int64) => "int[]", Array(Int32) => "int[]", Array(Int16) => "int[]", Array(Int8) => "int[]", Array(Float64) => "float[]", Array(Float32) => "float[]", Array(String) => "string[]", Array(Char) => "char[]", Array(Bool) => "bool[]", Array(Function) => "fn[]", Array(ValueType) => "any[]", Array => "any[]", Hash => "Table", Range(Int16 | Int32 | Int64 | Int8, Int16 | Int32 | Int64 | Int8) => "Range"}

Instance Method Summary

Instance Method Detail

def alias_type(alias_name : String, original : String) : Type #

[View source]
def assert(typedef : String, value : ValueType, token : Token) : Nil #

[View source]
def cast(value : T) : ValueType forall T #

[View source]
def cast_array(arr : Array(T)) : Array(ValueType) forall T #

[View source]
def cast_hash(hash : Hash(K, V)) : Hash(ValueType, ValueType) forall K, V #

[View source]
def get_mapped(t : Class) : String #

[View source]
def get_registered_type(name : String, token : Token) : Type | Nil #

[View source]
def get_registered_type?(typedef : String, token : Token) : Type | Nil #

[View source]
def is?(typedef : String, value, token : Token) : Bool #

[View source]
def register_intrinsics #

[View source]
def register_type(name : String) : Type #

[View source]
def reset #

[View source]