Skip to content

class Crystal::Call
inherits Crystal::ASTNode

A method call.

[ obj '.' ] name '(' ')' [ block ]

| [ obj '.' ] name '(' arg [ ',' arg ] ')' [ block ] | [ obj '.' ] name arg [ ',' arg ] [ block ] | arg name arg

The last syntax is for infix operators, and name will be the symbol of that operator instead of a string.

Class methods

.append_def_full_name(owner, a_def, arg_types, str)

View source

.def_full_name(owner, a_def, arg_types = nil)

View source

.full_name(owner, method_name = name)

View source

.global(name, arg1 : ASTNode, arg2 : ASTNode)

View source

.global(name, arg : ASTNode)

View source

.new(obj, name, arg1 : ASTNode, arg2 : ASTNode)

View source

.new(obj, name, arg : ASTNode)

View source

.new(obj, name, args = [] of ASTNode, block = nil, block_arg = nil, named_args = nil, global : Bool = false)

View source

Methods

#==(other : self)

Returns true if this reference is the same as other. Invokes same?.

#accept_children(visitor)

View source

#append_def_full_name(owner, a_def, arg_types, str)

View source

#append_error_when_no_matching_defs(owner, def_name, all_arguments_sizes, real_args_size, min_splat, defs, io)

View source

#append_matches(defs, arg_types, str, *, matched_def = nil, argument_name = nil)

View source

#args=(args : Array(ASTNode))

View source

#attach_subclass_observer(type : Type)

View source

#before_vars : MetaVars?

View source

#before_vars=(before_vars : MetaVars?)

View source

#block : Block?

View source

#block=(block : Block?)

View source

#block_arg : ASTNode?

View source

#block_arg=(block_arg : ASTNode?)

View source

#bubbling_exception

View source

#check_abstract_def_error(owner, matches, defs, def_name)

View source

#check_fun_arg_type_matches(obj_type, self_arg, typed_def_arg, index)

View source

#check_fun_args_size_match(obj_type, external)

View source

#check_fun_args_types_match(obj_type, typed_def)

View source

#check_fun_out_args(untyped_def)

View source

#check_lib_call_named_args(external)

View source

#check_macro_wrong_number_of_arguments(def_name)

View source

#check_named_args_mismatch(owner, arg_types, named_args, a_def)

View source

#check_not_lib_out_args

View source

#check_recursive_splat_call

View source

#check_return_type(typed_def, typed_def_return_type, match, match_owner)

View source

#check_tuple_indexer(owner, def_name, args, arg_types)

View source

#check_visibility(match)

View source

#clone_without_location

View source

#convert_numeric_argument(self_arg, unaliased_type, expected_type, actual_type, index)

View source

#convert_to_logical_operator(def_name)

View source

#def_full_name(owner, a_def, arg_types = nil)

View source

#doc : String?

Returns the doc comment attached to this node. Not every node supports having doc comments, so by default this returns nil.

View source

#doc=(doc : String?)

View source

#enclosing_def(context)

View source

#expanded : ASTNode?

View source

#expanded=(expanded : ASTNode?)

View source

#expanded_macro : Macro?

View source

#expanded_macro=(expanded_macro : Macro?)

View source

#expansion=(expansion)

View source

#expansion? : Bool

View source

#extract_missing_args(a_def, named_args)

View source

#full_name(owner, def_name = name)

View source

#global=(global : Bool)

View source

#global? : Bool

View source

#has_parentheses=(has_parentheses)

View source

#has_parentheses? : Bool

View source

#hash(hasher)

#in_macro_target

View source

#instantiate(signature, matches, owner, self_type, with_literals)

View source

#interpret(method : String, args : Array(ASTNode), named_args : Hash(String, ASTNode)?, block : Crystal::Block?, interpreter : Crystal::MacroInterpreter, name_loc : Location?)

View source

#lookup_macro

View source

#lookup_matches

View source

#lookup_matches(*, with_literals = false)

View source

#lookup_matches_checking_expansion(owner, signature, search_in_parents = true, with_literals = false)

View source

#lookup_matches_in(owner : Program, arg_types, named_args_types, self_type = nil, def_name = self.name, search_in_parents = true, with_literals = false)

View source

#lookup_matches_in(owner : AliasType, arg_types, named_args_types, self_type = nil, def_name = self.name, search_in_parents = true, with_literals = false)

View source

#lookup_matches_in(owner : UnionType, arg_types, named_args_types, self_type = nil, def_name = self.name, search_in_parents = true, with_literals = false)

View source

#lookup_matches_in(owner : FileModule, arg_types, named_args_types, self_type = nil, def_name = self.name, search_in_parents = true, with_literals = false)

View source

#lookup_matches_in(owner : NonGenericModuleType | GenericModuleInstanceType | GenericType, arg_types, named_args_types, self_type = nil, def_name = self.name, search_in_parents = true, with_literals = false)

View source

#lookup_matches_in(owner : LibType, arg_types, named_args_types, self_type = nil, def_name = self.name, search_in_parents = true, with_literals = false)

View source

#lookup_matches_in(owner : Type, arg_types, named_args_types, self_type = nil, def_name = self.name, search_in_parents = true, with_literals = false)

View source

#lookup_matches_in_type(owner, arg_types, named_args_types, self_type, def_name, search_in_parents, search_in_toplevel = true, with_literals = false)

View source

#lookup_matches_with_scope_in(owner, arg_types, named_args_types, with_literals = false)

View source

#lookup_matches_with_signature(owner, signature, search_in_parents, with_literals)

View source

#lookup_matches_with_signature(owner : Program, signature, search_in_parents, with_literals)

View source

#lookup_matches_with_splat(with_literals)

View source

#lookup_matches_without_splat(arg_types, named_args_types, with_literals)

View source

#lookup_previous_def_matches(arg_types, named_args_types, with_literals)

View source

#lookup_super_matches(arg_types, named_args_types, with_literals)

View source

#match_block_arg(match)

Match the given block with the given block argument specification (&block : A, B, C -> D)

View source

#missing_argument_message(a_def, named_args)

View source

#name=(name : String)

View source

#name_end_location

View source

#name_location : Location?

View source

#name_location=(name_location : Location?)

View source

#name_size

View source

#name_size=(name_size)

View source

#named_args : Array(NamedArgument)?

View source

#named_args=(named_args : Array(NamedArgument)?)

View source

#named_tuple_indexer_helper

View source

#obj=(obj : ASTNode?)

View source

#obj_and_args_types_set?

View source

#on_new_subclass

View source

#parent_visitor : MainVisitor

#parent_visitor=(parent_visitor : MainVisitor)

View source

#parent_visitor? : MainVisitor?

#prepare_typed_def_with_args(untyped_def, owner, self_type, arg_types, block_arg_type, named_args_types)

View source

#previous_def?

View source

#program

View source

#raise_abstract_method_must_be_implemented(a_def, owner)

View source

#raise_if_block_too_nested(block_nest)

View source

#raise_matches_not_found(owner, def_name, arg_types, named_args_types, matches = nil, with_literals = false)

View source

#raise_matches_not_found_for_virtual_metaclass_new(owner)

View source

#raises=(value)

View source

#raises? : Bool

View source

#recalculate

View source

#recalculate_lib_call(obj_type)

View source

#replace_block_arg_with_block(block_arg)

View source

#replace_splats

View source

#scope : Type

#scope=(scope : Type)

View source

#scope? : Type?

#single_def_error_message(defs, named_args)

View source

#super?

View source

#target_def

View source

#target_defs : Array(Def)?

View source

#target_defs=(target_defs : Array(Def)?)

View source

#to_macro_id

View source

#tuple_indexer_helper

View source

#uses_with_scope=(uses_with_scope)

View source

#uses_with_scope? : Bool

View source

#visibility=(visibility)

View source

#with_scope : Type?

View source

#with_scope=(with_scope : Type?)

View source