Skip to content

Commit

Permalink
.NET only
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed May 28, 2024
1 parent 2cbb51c commit 953e702
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bgen/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4945,6 +4945,7 @@ void GenerateProtocolTypes (Type type, string class_visibility, string TypeName,
print ("");
}

#if NET
// C# does not support type constraint on properties, so create Get* and Set* accessors instead.
foreach (var pi in staticProperties) {
GetAccessorInfo (pi, out var getter, out var setter, out var generate_getter, out var generate_setter);
Expand All @@ -4960,6 +4961,7 @@ void GenerateProtocolTypes (Type type, string class_visibility, string TypeName,
GenerateMethod (type, setter, false, null, false, false, false, ba?.Selector ?? attrib.ToSetter (pi).Selector, is_protocol_member: true);
}
}
#endif

foreach (var pi in requiredInstanceProperties) {
var minfo = new MemberInformation (this, this, pi, type);
Expand Down

0 comments on commit 953e702

Please sign in to comment.