Bindgen::Processor::BlockOverloads
Inherits Bindgen::Processor::Base < Bindgen::Graph::Visitor < Reference < Object
Generates overloads for methods that accept a block argument, and are told apart by it alone. Those methods are ambiguous because Crystal does not permit overloading through different type restrictions on the block; this processor rectifies this by requiring each overload to also specify the types of the block parameters. For example, the following code
def f(& : Int32 ->)
end
def f(& : Bool ->)
end
def f(& : Int32, Bool ->)
end
is transformed into
def f(_type1_ : Int32.class, & : Int32 ->)
end
def f(_type1_ : Bool.class, & : Bool ->)
end
def f(_type1_ : Int32.class, _type2_ : Bool.class, & : Int32, Bool ->)
end
The type arguments go before any other arguments, which the overloads
share: on_changed(_type1_ : Int32.class, type : ConnectionType, &).
Unambiguous methods that accept block arguments are unaffected, and so
are overloads differing in the other arguments.
Constants
Generates overloads for methods that accept a block argument, and are told apart by it alone. Those methods are ambiguous because Crystal does not permit overloading through different type restrictions on the block; this processor rectifies this by requiring each overload to also specify the types of the block parameters. For example, the following code
def f(& : Int32 ->)
end
def f(& : Bool ->)
end
def f(& : Int32, Bool ->)
end
is transformed into
def f(_type1_ : Int32.class, & : Int32 ->)
end
def f(_type1_ : Bool.class, & : Bool ->)
end
def f(_type1_ : Int32.class, _type2_ : Bool.class, & : Int32, Bool ->)
end
The type arguments go before any other arguments, which the overloads
share: on_changed(_type1_ : Int32.class, type : ConnectionType, &).
Unambiguous methods that accept block arguments are unaffected, and so
are overloads differing in the other arguments.
Instance methods
Visits a Graph::Class. The default implementation calls
#visit_children to visit all child nodes.