jhass / crystal-gobject

gobject-introspection for Crystal
BSD 3-Clause "New" or "Revised" License
127 stars 13 forks source link

Resolve undefined variables for optional Enumerable arguments #97

Closed christopherzimmerman closed 2 years ago

christopherzimmerman commented 2 years ago

Closes #96

Since the children of the def_if also check for the validity of the arguments, removing the def_if entirely and just setting acceptable default values for a single path correctly handles optional arguments.

require "gobject"
require_gobject "Arrow"

b = Arrow::Buffer.new(Bytes.new(10))
arr = Arrow::Tensor.new(Arrow::UInt8DataType.new, b, [10], [1], nil)
puts arr

# <Arrow::Tensor:0x1053b7d80>
jhass commented 2 years ago

Great find!

Thank you!