Skip to content

Commit

Permalink
Add locations to c struct vars to allow them to appear in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodywasishere committed Jul 17, 2024
1 parent 9a9202b commit 2ac8581
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/crystal/semantic/type_declaration_visitor.cr
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ class Crystal::TypeDeclarationVisitor < Crystal::SemanticVisitor

def declare_c_struct_or_union_field(type, field_name, var, location)
type.instance_vars[var.name] = var
type.add_def Def.new("#{field_name}=", [Arg.new("value")], Primitive.new("struct_or_union_set").at(location))
type.add_def Def.new(field_name, body: InstanceVar.new(var.name))
type.add_def Def.new("#{field_name}=", [Arg.new("value")], Primitive.new("struct_or_union_set").at(location)).at(location)
type.add_def Def.new(field_name, body: InstanceVar.new(var.name)).at(location)
end

def declare_instance_var(node, var)
Expand Down

0 comments on commit 2ac8581

Please sign in to comment.