class Mint::TypeChecker
- Mint::TypeChecker
- Reference
- Object
Defined in:
macros.crtype_checker.cr
type_checker/artifacts.cr
type_checker/comparer.cr
type_checker/partial_record.cr
type_checker/record.cr
type_checker/scope.cr
type_checker/type.cr
type_checker/variable.cr
type_checkers/access.cr
type_checkers/argument.cr
type_checkers/array_access.cr
type_checkers/array_literal.cr
type_checkers/block.cr
type_checkers/bool_literal.cr
type_checkers/call.cr
type_checkers/case.cr
type_checkers/case_branch.cr
type_checkers/comment.cr
type_checkers/component.cr
type_checkers/connect.cr
type_checkers/constant.cr
type_checkers/css_definition.cr
type_checkers/css_font_face.cr
type_checkers/css_interpolation.cr
type_checkers/css_keyframes.cr
type_checkers/css_nested_at.cr
type_checkers/css_selector.cr
type_checkers/decode.cr
type_checkers/destructuring.cr
type_checkers/directives/asset.cr
type_checkers/directives/documentation.cr
type_checkers/directives/format.cr
type_checkers/directives/highlight.cr
type_checkers/directives/inline.cr
type_checkers/directives/svg.cr
type_checkers/encode.cr
type_checkers/enum.cr
type_checkers/enum_id.cr
type_checkers/enum_option.cr
type_checkers/enum_record_definition.cr
type_checkers/env.cr
type_checkers/for_expression.cr
type_checkers/function.cr
type_checkers/get.cr
type_checkers/here_doc.cr
type_checkers/html_attribute.cr
type_checkers/html_component.cr
type_checkers/html_content.cr
type_checkers/html_element.cr
type_checkers/html_expression.cr
type_checkers/html_fragment.cr
type_checkers/html_style.cr
type_checkers/if.cr
type_checkers/inline_function.cr
type_checkers/js.cr
type_checkers/locale.cr
type_checkers/locale_key.cr
type_checkers/member_access.cr
type_checkers/module.cr
type_checkers/module_access.cr
type_checkers/negated_expression.cr
type_checkers/next_call.cr
type_checkers/number_literal.cr
type_checkers/operation.cr
type_checkers/parenthesized_expression.cr
type_checkers/pipe.cr
type_checkers/property.cr
type_checkers/provider.cr
type_checkers/record.cr
type_checkers/record_constructor.cr
type_checkers/record_definition.cr
type_checkers/record_definition_field.cr
type_checkers/record_field.cr
type_checkers/record_update.cr
type_checkers/regexp_literal.cr
type_checkers/return_call.cr
type_checkers/route.cr
type_checkers/routes.cr
type_checkers/state.cr
type_checkers/statement.cr
type_checkers/store.cr
type_checkers/string_literal.cr
type_checkers/style.cr
type_checkers/suite.cr
type_checkers/test.cr
type_checkers/top_level.cr
type_checkers/tuple_literal.cr
type_checkers/type.cr
type_checkers/type_variable.cr
type_checkers/unary_minus.cr
type_checkers/use.cr
type_checkers/variable.cr
type_checkers/void.cr
Constant Summary
-
ARRAY =
Type.new("Array", [Variable.new("a")] of Checkable)
-
BOOL =
Type.new("Bool")
-
CSS_PROPERTY_NAMES =
({{ read_file("/srv/crystaldoc.info/github-mint-lang-mint-0.19.0/src/type_checkers/../assets/css_properties") }}).strip.lines
-
EVENT =
Type.new("Html.Event")
-
EVENT_FUNCTION =
Type.new("Function", [EVENT, Variable.new("a")] of Checkable)
-
HTML =
Type.new("Html")
-
HTML_CHILDREN =
Type.new("Array", [HTML] of Checkable)
-
MAP =
Type.new("Map", [Variable.new("a"), Variable.new("a")] of Checkable)
-
MAYBE =
Type.new("Maybe", [Variable.new("a")] of Checkable)
-
NUMBER =
Type.new("Number")
-
OBJECT =
Type.new("Object")
-
OBJECT_ERROR =
Type.new("Object.Error")
-
REGEXP =
Type.new("Regexp")
-
RESERVED =
["break", "case", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "export", "extends", "for", "if", "import", "in", "instanceof", "new", "return", "super", "switch", "this", "throw", "typeof", "var", "void", "while", "yield", "state"] of ::String
-
RESULT =
Type.new("Result", [Variable.new("a"), Variable.new("b")] of Checkable)
-
SET =
Type.new("Set", [Variable.new("a")] of Checkable)
-
STRING =
Type.new("String")
-
STYLE_MAP =
Type.new("Map", [STRING, STRING] of Checkable)
-
TEST_CONTEXT =
Type.new("Test.Context", [Variable.new("a")] of Checkable)
-
TEXT_CHILDREN =
Type.new("Array", [STRING] of Checkable)
-
TIME =
Type.new("Time")
-
VALID_IF_TYPES =
[VOID_PROMISE, STRING, ARRAY, MAYBE, VOID, HTML] of Checkable
-
VOID =
Type.new("Void")
-
VOID_FUNCTION =
Type.new("Function", [Variable.new("a")] of Checkable)
-
VOID_PROMISE =
Type.new("Promise", [VOID] of Checkable)
Constructors
Class Method Summary
Instance Method Summary
- #add_record(record : Record, node)
- #add_record(record, node)
- #argument_order(*args, **options)
- #argument_order(*args, **options, &)
- #artifacts : Mint::TypeChecker::Artifacts
- #assets(*args, **options)
- #assets(*args, **options, &)
- #ast(*args, **options)
- #ast(*args, **options, &)
- #cache(*args, **options)
- #cache(*args, **options, &)
- #check(parameters : Array(Ast::Node), names : Array(Ast::TypeVariable), used_parameters : Set(Ast::TypeVariable))
- #check(node : Ast::CaseBranch, condition : Checkable) : Checkable
- #check(node : Ast::EnumId, parent : Ast::Enum)
- #check(node : Ast::HtmlAttribute, element : Ast::HtmlFragment)
- #check(node : Ast::HtmlAttribute, element : Ast::HtmlElement) : Checkable
- #check(node : Ast::HtmlAttribute, component : Ast::Component) : Checkable
- #check(node : Ast::EnumId, record : Record) : Checkable
- #check(node : Ast::Access) : Checkable
- #check(node : Ast::Argument) : Checkable
- #check(node : Ast::ArrayAccess) : Checkable
- #check(node : Ast::ArrayLiteral) : Checkable
- #check(node : Ast::Block) : Checkable
- #check(node : Ast::BoolLiteral) : Checkable
- #check(node : Ast::CallExpression)
- #check(node : Ast::Call)
- #check(node : Ast::Case) : Checkable
- #check(node : Ast::Comment) : Checkable
- #check(node : Ast::Component) : Checkable
- #check(node : Ast::Connect) : Checkable
- #check(node : Ast::Constant) : Checkable
- #check(node : Ast::CssDefinition) : Checkable
- #check(node : Ast::CssFontFace) : Checkable
- #check(node : Ast::Interpolation) : Checkable
- #check(node : Ast::CssKeyframes) : Checkable
- #check(node : Ast::CssNestedAt) : Checkable
- #check(node : Ast::CssSelector) : Checkable
- #check(node : Ast::Decode) : Checkable
- #check(node : Ast::Encode) : Checkable
- #check(node : Ast::Enum) : Checkable
-
#check(node : Ast::EnumId) : Checkable
This checks all entities that starts with an uppercase character - enums - record constructors - constants
- #check(node : Ast::EnumOption) : Checkable
- #check(node : Ast::EnumRecordDefinition) : Checkable
- #check(node : Ast::Env) : Checkable
- #check(node : Ast::For) : Checkable
- #check(node : Ast::Function) : Checkable
- #check(node : Ast::Get) : Checkable
- #check(node : Ast::HereDoc) : Checkable
- #check(node : Ast::HtmlComponent) : Checkable
- #check(node : Ast::HtmlElement) : Checkable
- #check(node : Ast::HtmlExpression) : Checkable
- #check(node : Ast::HtmlFragment) : Checkable
- #check(node : Ast::HtmlStyle) : Checkable
- #check(node : Ast::If) : Checkable
- #check(node : Ast::InlineFunction) : Checkable
- #check(node : Ast::Js) : Checkable
- #check(node : Ast::LocaleKey) : Checkable
- #check(node : Ast::MemberAccess) : Checkable
- #check(node : Ast::Module) : Checkable
- #check(node : Ast::ModuleAccess) : Checkable
- #check(node : Ast::NegatedExpression) : Checkable
- #check(node : Ast::NextCall) : Checkable
- #check(node : Ast::NumberLiteral) : Checkable
- #check(node : Ast::Operation) : Checkable
- #check(node : Ast::ParenthesizedExpression) : Checkable
- #check(node : Ast::Pipe) : Checkable
- #check(node : Ast::Property) : Checkable
- #check(node : Ast::Provider) : Checkable
- #check(node : Ast::Record, should_create_record : Bool = false) : Checkable
- #check(node : Ast::RecordDefinition) : Checkable
- #check(node : Ast::RecordDefinitionField) : Checkable
- #check(node : Ast::RecordField, should_create_record : Bool = false) : Checkable
- #check(node : Ast::RecordUpdate) : Checkable
- #check(node : Ast::RegexpLiteral) : Checkable
- #check(node : Ast::ReturnCall) : Checkable
- #check(node : Ast::Route) : Checkable
- #check(node : Ast::Routes) : Checkable
- #check(node : Ast::State) : Checkable
- #check(node : Ast::Statement) : Checkable
- #check(node : Ast::Store) : Checkable
- #check(node : Ast::StringLiteral) : Checkable
- #check(node : Ast::Style) : Checkable
- #check(node : Ast::Suite)
- #check(node : Ast::Test)
- #check(node : Ast) : Checkable
- #check(node : Ast::TupleLiteral) : Checkable
- #check(node : Ast::Type) : Checkable
- #check(node : Ast::TypeVariable) : Checkable
- #check(node : Ast::UnaryMinus) : Checkable
- #check(node : Ast::Use) : Checkable
- #check(node : Ast::Variable) : Checkable
- #check(node : Ast::Void) : Checkable
- #check(node : Ast::Directives::Asset) : Checkable
- #check(node : Ast::Directives::Documentation) : Checkable
- #check(node : Ast::Directives::Format) : Checkable
- #check(node : Ast::Directives::Highlight) : Checkable
- #check(node : Ast::Directives::Inline) : Checkable
- #check(node : Ast::Directives::Svg) : Checkable
- #check(node : Checkable) : Checkable
- #check(nodes : Array(Ast::Node)) : Array(Checkable)
- #check(node : Ast::Node) : Checkable
- #check : Artifacts
- #check!(node)
-
#check_all(node : Ast::Component) : Checkable
Check all nodes that were not checked before
- #check_all(node : Ast::Module) : Checkable
- #check_all(nodes : Array(Ast::Node)) : Array(Checkable)
- #check_arguments(arguments : Array(Ast::Argument))
- #check_array_access(lhs, type)
- #check_call(node, function_type) : Checkable
- #check_decode(type : Checkable)
- #check_global_names(name : String, node : Ast::Node) : Nil
- #check_global_types(name : String, node : Ast::Node) : Nil
- #check_html(nodes : Array(Ast::Node)) : Checkable
- #check_locale(node : Ast::Locale)
- #check_locale_record(node : Ast::RecordField, prefix : String | Nil, language : String)
- #check_names(nodes : Array(Ast::Function | Ast::Get | Ast::Property | Ast::State), error : Mint::TypeError.class, resolved = {} of String => Ast::Node) : Nil
- #check_variable(variable)
- #checked(*args, **options)
- #checked(*args, **options, &)
- #checking=(checking : Bool)
- #checking? : Bool
- #component(*args, **options)
- #component(*args, **options, &)
- #component?(*args, **options)
- #component?(*args, **options, &)
- #component_records(*args, **options)
- #component_records(*args, **options, &)
- #create_record(fields)
- #current_top_level_entity?(*args, **options)
- #current_top_level_entity?(*args, **options, &)
- #debug
- #destructure(node : Nil, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope)
-
#destructure(node : Ast::Variable, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope)
This is for the
let
statement when it's a single assignment - #destructure(node : Ast::ArrayDestructuring, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope)
- #destructure(node : Ast::TupleDestructuring, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope)
- #destructure(node : Ast::EnumDestructuring, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope)
- #destructure(node : Ast::Node, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope)
- #extract_variables(node : Checkable) : Hash(String, Checkable)
- #format(*args, **options)
- #format(*args, **options, &)
- #formatter : Mint::Formatter
- #locales(*args, **options)
- #locales(*args, **options, &)
- #lookup(node : Ast::Variable)
- #lookup_with_level(node : Ast::Variable)
- #lookups(*args, **options)
- #lookups(*args, **options, &)
- #ordinal(number)
- #print_stack
- #push_return(node : Ast::ReturnCall)
- #record_field_lookup(*args, **options)
- #record_field_lookup(*args, **options, &)
- #records : Array(Mint::TypeChecker::Record)
- #resolve(nodes : Array(Ast::Node)) : Array(Checkable)
- #resolve(node : Ast::Node | Checkable, *args) : Checkable
- #resolve(nodes : Array(Ast::Node), *args) : Array(Checkable)
- #resolve_order(*args, **options)
- #resolve_order(*args, **options, &)
- #resolve_record_definition(name)
- #resolve_records
- #resolve_type(node : Record | Variable)
- #resolve_type(node : Js)
- #resolve_type(node : Type)
- #scope : Mint::TypeChecker::Scope
- #scope(node : Scope::Node, &)
- #scope(nodes, &)
- #stateful?(*args, **options)
- #stateful?(*args, **options, &)
- #static_type_signature(node : Ast::Component)
- #static_type_signature(node : Ast::Function) : Checkable
- #static_type_signature(node : Ast::Get) : Checkable
- #static_type_signature(node : Ast::HtmlElement) : Checkable
- #static_type_signature(node : Ast::InlineFunction) : Checkable
- #static_type_signature(node : Ast::Property) : Checkable
- #static_type_signature(node : Ast::State) : Checkable
- #types(*args, **options)
- #types(*args, **options, &)
- #variables(*args, **options)
- #variables(*args, **options, &)
- #web_components : Array(String)
- #with_restricted_top_level_entity(referee : Mint::Ast::Node | Nil, &)
- #with_returns(node : Ast::Node, &)
Macro Summary
Constructor Detail
Class Method Detail
Instance Method Detail
def check(parameters : Array(Ast::Node), names : Array(Ast::TypeVariable), used_parameters : Set(Ast::TypeVariable))
#
This checks all entities that starts with an uppercase character
- enums
- record constructors
- constants
Check all nodes that were not checked before
def check_names(nodes : Array(Ast::Function | Ast::Get | Ast::Property | Ast::State), error : Mint::TypeError.class, resolved = {} of String => Ast::Node) : Nil
#
def destructure(node : Nil, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope)
#
def destructure(node : Ast::Variable, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope)
#
This is for the let
statement when it's a single assignment
def destructure(node : Ast::ArrayDestructuring, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope)
#
def destructure(node : Ast::TupleDestructuring, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope)
#
def destructure(node : Ast::EnumDestructuring, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope)
#
def destructure(node : Ast::Node, condition : Checkable, variables : Array(VariableScope) = [] of VariableScope)
#