Skip to content

Fix helper methods for private fields of structs/unions #30

Closed
@kornilova203

Description

@kornilova203

Currently this struct:

struct MyStruct {
private:
    int field1;
    int filed2;
};

produces this implicit helper class:

implicit class struct_MyStruct_ops(val p: native.Ptr[struct_MyStruct]) extends AnyVal {
  def `private`: native.CInt = !p._1 // incorrect name
  def `private_`=(value: native.CInt):Unit = !p._1 = value
  def filed2: native.CInt = !p._2
  def filed2_=(value: native.CInt):Unit = !p._2 = value
}

First field has wrong name (private instead of field1)
I suppose that implicit class should not contain getters and setters for private fields

Metadata

Metadata

Assignees

No one assigned

    Labels

    bindgenBinding generator

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions