Skip to content

Commit

Permalink
Merge pull request #18085 from Youssef1313/init-only
Browse files Browse the repository at this point in the history
fix: Consider init-only properties as not settable in bindable type generator
  • Loading branch information
Youssef1313 authored Aug 31, 2024
2 parents 8122799 + 46e75e2 commit 0a56fe8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ where field.IsStatic

if (
property.SetMethod != null
&& property.SetMethod != null
&& !property.SetMethod.IsInitOnly
&& property.SetMethod.IsLocallyPublic(_currentModule!)
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ public int? MyProperty
}
}
}

#if !WINAPPSDK // https://github.com/microsoft/microsoft-ui-xaml/issues/5315
public int MyInitOnlyProperty { get; init; }
#endif
}

0 comments on commit 0a56fe8

Please sign in to comment.