Skip to content

Commit

Permalink
Merge pull request #986 from gircore/field-readable-by-default
Browse files Browse the repository at this point in the history
Make struct fields readable by default
  • Loading branch information
badcel authored Dec 3, 2023
2 parents 5368097 + 3d88ad3 commit 416af19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Generation/GirLoader/Input/Field.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class Field : AnyType
public string? Name { get; set; }

[XmlAttribute("readable")]
public bool Readable { get; set; }
public bool Readable { get; set; } = true;

[XmlAttribute("writable")]
public bool Writable { get; set; }
Expand All @@ -32,5 +32,5 @@ public class Field : AnyType
public Doc? Doc { get; set; }

[XmlAttribute("introspectable")]
public bool Introspectable = true;
public bool Introspectable { get; set; } = true;
}
4 changes: 2 additions & 2 deletions src/Generation/GirLoader/Output/Field.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public partial class Field
/// <param name="writable"></param>
/// <param name="private"></param>
/// <param name="name"></param>
public Field(string name, TypeReference typeReference, bool introspectable, bool readable = true, bool writable = false, bool @private = false)
public Field(string name, TypeReference typeReference, bool introspectable, bool readable, bool writable, bool @private)
{
Name = name;
TypeReference = typeReference;
Expand All @@ -32,7 +32,7 @@ public Field(string name, TypeReference typeReference, bool introspectable, bool
Introspectable = introspectable;
}

public Field(string name, ResolveableTypeReference resolveableTypeReference, Callback callback, bool introspectable, bool readable = true, bool writable = false, bool @private = false)
public Field(string name, ResolveableTypeReference resolveableTypeReference, Callback callback, bool introspectable, bool readable, bool writable, bool @private)
: this(name, resolveableTypeReference, introspectable, readable, writable, @private)
{
Callback = callback;
Expand Down

0 comments on commit 416af19

Please sign in to comment.