module Cosmo::TypeChecker

Extended Modules

Defined in:

cosmo/runtime/typechecker.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", Float64 => "float", Float32 => "float", String => "string", Char => "char", Bool => "bool", Nil => "none", ClassInstance => "classinstance", Class => "class", Type => "type", Function => "func", 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(ValueType, ValueType) => "Table", Range(Int128 | Int16 | Int32 | Int64 | Int8, Int128 | Int16 | Int32 | Int64 | Int8) => "Range"}

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 : ValueType, type : Token) : ValueType #

[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]