From 72f4147c5261890e10b8f9615d3d4ae33dc4d5ec Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Mon, 3 Feb 2025 13:41:38 -0800 Subject: [PATCH] Update breaking change rules regarding byref/objref fields. (#112087) New rule based on https://github.com/dotnet/runtime/pull/111584 --------- Co-authored-by: Stephen Toub --- docs/coding-guidelines/breaking-change-rules.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/coding-guidelines/breaking-change-rules.md b/docs/coding-guidelines/breaking-change-rules.md index e8a5e5b7d0afda..21fc3103106f35 100644 --- a/docs/coding-guidelines/breaking-change-rules.md +++ b/docs/coding-guidelines/breaking-change-rules.md @@ -236,6 +236,8 @@ successfully bind to that overload, if simply passing an `int` value. However, i Definite assignment rules allow use of uninitialized variables so long as the variable type is a stateless struct. If the struct is made stateful, code could now end up with uninitialized data. This is both potentially a source breaking and binary breaking change. +* Adding a reference type field, a `ref` field, or a field involving a generic type parameter without the `unmanaged` constraint, to a value type that formerly had none of those field kinds. If the value type already contains at least one such field, adding another is non-breaking. This rule applies recursively to new fields that contain value types that may also introduce a new field kind. + ### Signatures ✓ **Allowed** * Adding `params` to a parameter