module Cosmo::TypeChecker

Extended Modules

Defined in:

cosmo/runtime/type_checker.cr

Constant Summary

ALIASES = {} of String => String
REGISTERED = [] of Type
TYPE_MAP = {Int128 => "bigint", Int64 => "int", Int32 => "int", Int16 => "int", Int8 => "int", UInt64 => "uint", UInt32 => "uint", UInt32 => "uint", UInt16 => "uint", UInt8 => "uint", Float64 => "float", Float32 => "float", String => "string", Char => "char", Bool => "bool", Nil => "none", ClassInstance => "classinstance", Class => "class", Type => "type", Function => "Function", Intrinsic::IFunction => "intrinsic_fn", RangeType => "Range", Spread => "Spread"}

Instance Method Summary

Instance Method Detail

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

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

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

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

[View source]
def cast(value : ValueType, type : Token) : ValueType #

[View source]
def cast?(value : T, type : Token) : ValueType forall T #

array types


[View source]
def get_mapped(t : CrystalClass) : 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 hash_as_value_type(hash : Hash(K, V)) : Hash(ValueType, ValueType) forall K, V #

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

[View source]
def register_intrinsics #

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

[View source]
def reset #

[View source]