Skip to content

Commit 46af688

Browse files
authored
Fix incorrect word (#45332)
Fixes #45319 The word *string* should have been *struct*.
1 parent 432bec1 commit 46af688

File tree

1 file changed

+1
-1
lines changed
  • docs/csharp/language-reference/builtin-types

1 file changed

+1
-1
lines changed

docs/csharp/language-reference/builtin-types/struct.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ All of a struct's member fields must be *definitely assigned* when created becau
132132
- You can add *field initializers* to any field or auto implemented property.
133133
- You can initialize any fields, or auto properties, in the body of the constructor.
134134

135-
Beginning with C# 11, if you don't initialize all fields in a struct, the compiler adds code to the constructor that initializes those fields to the default value. A struct assigned to its `default` value is initialized to the 0-bit pattern. A string initialized with `new` is initialized to the 0-bit pattern, followed by executing any field initializers and a constructor.
135+
Beginning with C# 11, if you don't initialize all fields in a struct, the compiler adds code to the constructor that initializes those fields to the default value. A struct assigned to its `default` value is initialized to the 0-bit pattern. A struct initialized with `new` is initialized to the 0-bit pattern, followed by executing any field initializers and a constructor.
136136

137137
:::code language="csharp" source="snippets/shared/StructType.cs" id="FieldInitializer":::
138138

0 commit comments

Comments
 (0)