hugopl / gi-crystal

Tool to generate Crystal bindings for gobject-based libraries (i.e. GTK)
BSD 3-Clause "New" or "Revised" License
45 stars 3 forks source link

syntax error in './gsk-4.0/path_point.cr:122:13': can't use variable name 'center' inside assignment to variable 'center' #144

Open GeopJr opened 6 months ago

GeopJr commented 6 months ago

This is on 46beta, the generated code is:

def curvature(path : Gsk::Path,direction : Gsk::PathDirection,) : Graphene::Point
  # gsk_path_point_get_curvature: (Method)
# @path: 
# @direction: 
# @center: (out) (nullable) (caller-allocates) 
# Returns: (transfer none) 

  # Generator::NullableArrayPlan
center = if center.nil?
Void.null
else
center.to_unsafe
end
# Generator::CallerAllocatesPlan
center=Graphene::Point.new
  # C call
  _retval = LibGsk.gsk_path_point_get_curvature(to_unsafe, path, direction, center)

  # Return value handling
  center

end

The order doesn't really make much sense as center gets overwritten afterwards anyway?

GeopJr commented 6 months ago

This is the same issue as the harfbuzz one some versions ago, I don't know if curvature should also be ignored nvm

GeopJr commented 6 months ago

Closing as this has been fixed on gtk4.cr

hugopl commented 6 months ago

I think we can keep this open here, since gtk4 shard doesn't really fix it but just ignore the function.