Skip to content

Commit 2595bb9

Browse files
authored
Fix ECMA standard warnings (dotnet#55344)
* Remove some comments This is just forcing a build. * Update all warnings Fix the build warnings.
1 parent 9be775a commit 2595bb9

10 files changed

Lines changed: 18 additions & 26 deletions

File tree

docs/csharp/language-reference/builtin-types/default-values.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ For more information, see the following sections of the [C# language specificati
5757

5858
- [Default values](~/_csharpstandard/standard/variables.md#93-default-values)
5959
- [Default constructors](~/_csharpstandard/standard/types.md#833-default-constructors)
60-
- [Parameterless struct constructors](~/_csharpstandard/standard/structs.md#1659-constructors)
61-
- [Auto default structs](~/_csharpstandard/standard/structs.md#16581-field-initializers)
60+
- [Parameterless struct constructors](~/_csharpstandard/standard/structs.md#1669-constructors)
61+
- [Auto default structs](~/_csharpstandard/standard/structs.md#16681-field-initializers)
6262

6363
## See also
6464

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ For more information, see the [Classes](~/_csharpstandard/standard/classes.md) s
262262

263263
For more information about these features, see the following feature proposal notes:
264264

265-
- [Records](~/_csharpstandard/standard/classes.md#1516-synthesized-record-class-members)
265+
- [Records](~/_csharpstandard/standard/classes.md#1516-record-classes)
266266
- [Init-only setters](~/_csharpstandard/standard/classes.md#15733-init-accessors)
267267
- [Covariant returns](~/_csharpstandard/standard/classes.md#1565-override-methods)
268268

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ The compiler enforces these restrictions. If you write `ref struct` types that i
8585
For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md):
8686

8787
- [Structs: Ref modifier](~/_csharpstandard/standard/structs.md#1623-ref-modifier)
88-
- [Safe context constraint for ref struct types](~/_csharpstandard/standard/structs.md#16515-safe-context-constraint)
88+
- [Safe context constraint for ref struct types](~/_csharpstandard/standard/structs.md#16615-safe-context-constraint)
8989

90-
For more information about `ref` fields, see [Ref fields](~/_csharpstandard/standard/structs.md#16582-ref-fields) in the C# language specification.
90+
For more information about `ref` fields, see [Ref fields](~/_csharpstandard/standard/structs.md#16682-ref-fields) in the C# language specification.
9191

9292
## See also
9393

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ If you don't initialize all fields in a struct, the compiler adds code to the co
140140

141141
:::code language="csharp" source="snippets/shared/StructType.cs" id="FieldInitializer":::
142142

143-
Every `struct` has a `public` parameterless constructor. If you write a parameterless constructor, it must be public. If a struct declares any field initializers, it must explicitly declare a constructor. That constructor need not be parameterless. If a struct declares a field initializer but no constructors, the compiler reports an error. Any explicitly declared constructor (with parameters, or parameterless) executes all field initializers for that struct. All fields without a field initializer or an assignment in a constructor are set to the [default value](default-values.md). For more information, see the [C# language specification—Constructors](~/_csharpstandard/standard/structs.md#1659-constructors).
143+
Every `struct` has a `public` parameterless constructor. If you write a parameterless constructor, it must be public. If a struct declares any field initializers, it must explicitly declare a constructor. That constructor need not be parameterless. If a struct declares a field initializer but no constructors, the compiler reports an error. Any explicitly declared constructor (with parameters, or parameterless) executes all field initializers for that struct. All fields without a field initializer or an assignment in a constructor are set to the [default value](default-values.md). For more information, see the [C# language specification—Constructors](~/_csharpstandard/standard/structs.md#1669-constructors).
144144

145145
Beginning with C# 12, `struct` types can define a [primary constructor](../../programming-guide/classes-and-structs/instance-constructors.md#primary-constructors) as part of its declaration. Primary constructors provide a concise syntax for constructor parameters that can be used throughout the `struct` body, in any member declaration for that struct.
146146

@@ -176,11 +176,11 @@ For more information, see the [Structs](~/_csharpstandard/standard/structs.md) s
176176

177177
- [Readonly structs](~/_csharpstandard/standard/structs.md#1622-struct-modifiers)
178178
- [Readonly instance members](~/_csharpstandard/standard/structs.md#163-struct-members)
179-
- [Parameterless struct constructors](~/_csharpstandard/standard/structs.md#1659-constructors)
179+
- [Parameterless struct constructors](~/_csharpstandard/standard/structs.md#1669-constructors)
180180
- [Allow `with` expression on structs](~/_csharpstandard/standard/expressions.md#1210-with-expressions)
181-
- [Record structs](~/_csharpstandard/standard/structs.md#164-synthesized-record-struct-members)
181+
- [Record structs](~/_csharpstandard/standard/structs.md#164-record-structs)
182182

183-
You can also read about [Auto default structs](~/_csharpstandard/standard/structs.md#16581-field-initializers) in the C# language specification.
183+
You can also read about [Auto default structs](~/_csharpstandard/standard/structs.md#16681-field-initializers) in the C# language specification.
184184

185185
## See also
186186

docs/csharp/language-reference/compiler-messages/record-declaration-errors.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ In addition, this article covers the following warning:
9797
- **CS8879**: *Record member 'member' must be private.*
9898
- **CS8906**: *Record equality contract property 'member' must have a get accessor.*
9999

100-
When you explicitly declare a member that the compiler would otherwise synthesize for a [record type](../builtin-types/record.md), your declaration must match the expected signature, accessibility, and modifiers. For the complete rules, see the [records specification](~/_csharpstandard/standard/classes.md#1516-synthesized-record-class-members) in the C# language specification.
100+
When you explicitly declare a member that the compiler would otherwise synthesize for a [record type](../builtin-types/record.md), your declaration must match the expected signature, accessibility, and modifiers. For the complete rules, see the [records specification](~/_csharpstandard/standard/classes.md#1516-record-classes) in the C# language specification.
101101

102102
To correct these errors, apply the following changes to your explicitly declared record members:
103103

@@ -119,7 +119,7 @@ To correct these errors, apply the following changes to your explicitly declared
119119
- **CS8908**: *The type 'type' may not be used for a field of a record.*
120120
- **CS8913**: *The positional member 'member' found corresponding to this parameter is hidden.*
121121

122-
When you declare a [positional record](../builtin-types/record.md#positional-syntax-for-property-and-field-definition), the compiler synthesizes properties that correspond to each positional parameter. These diagnostics indicate that your explicit declarations conflict with those synthesized properties. For the complete rules, see the [records specification](~/_csharpstandard/standard/classes.md#1516-synthesized-record-class-members) in the C# language specification.
122+
When you declare a [positional record](../builtin-types/record.md#positional-syntax-for-property-and-field-definition), the compiler synthesizes properties that correspond to each positional parameter. These diagnostics indicate that your explicit declarations conflict with those synthesized properties. For the complete rules, see the [records specification](~/_csharpstandard/standard/classes.md#1516-record-classes) in the C# language specification.
123123

124124
To correct these errors, apply the following changes to your positional record declarations:
125125

@@ -147,7 +147,7 @@ To correct these errors, apply the following changes:
147147
- **CS8864**: *Records may only inherit from object or another record*
148148
- **CS8865**: *Only records may inherit from records.*
149149

150-
[Record class types](../builtin-types/record.md) follow specific [inheritance](../builtin-types/record.md#equality-in-inheritance-hierarchies) rules. For the complete rules, see the [records specification](~/_csharpstandard/standard/classes.md#1516-synthesized-record-class-members) in the C# language specification.
150+
[Record class types](../builtin-types/record.md) follow specific [inheritance](../builtin-types/record.md#equality-in-inheritance-hierarchies) rules. For the complete rules, see the [records specification](~/_csharpstandard/standard/classes.md#1516-record-classes) in the C# language specification.
151151

152152
To correct these errors, apply the following changes:
153153

@@ -159,7 +159,7 @@ To correct these errors, apply the following changes:
159159
- **CS8859**: *Members named 'Clone' are disallowed in records.*
160160
- **CS8860**: *Types and aliases should not be named 'record'.*
161161

162-
The compiler reserves certain names for use with [record types](../builtin-types/record.md). For the complete rules, see the [records specification](~/_csharpstandard/standard/classes.md#1516-synthesized-record-class-members) in the C# language specification.
162+
The compiler reserves certain names for use with [record types](../builtin-types/record.md). For the complete rules, see the [records specification](~/_csharpstandard/standard/classes.md#1516-record-classes) in the C# language specification.
163163

164164
To correct these errors, apply the following changes:
165165

docs/csharp/language-reference/compiler-messages/ref-modifiers-errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ To correct these errors:
268268
- Remove the `unscoped` modifier or the <xref:System.Diagnostics.CodeAnalysis.UnscopedRefAttribute?displayProperty=nameWithType> attribute from struct constructors and init-only members. These members have special initialization semantics where the compiler must ensure that any references don't outlive the initialization phase, and allowing unscoped references would violate the guarantee that initialization completes before the struct becomes fully accessible (**CS9101**).
269269
- Remove the `unscoped` modifier from interface implementation methods when the corresponding interface method doesn't have it. The unscoped characteristic affects the method's contract regarding reference lifetime guarantees, and implementations must maintain the same contract as the interface they're implementing to ensure callers can rely on consistent lifetime behavior regardless of which implementation is invoked (**CS9102**).
270270

271-
For more information about scoped and unscoped references, see [Method parameters](../keywords/method-parameters.md) and [Safe context constraint](~/_csharpstandard/standard/structs.md#16515-safe-context-constraint) in the C# language specification.
271+
For more information about scoped and unscoped references, see [Method parameters](../keywords/method-parameters.md) and [Safe context constraint](~/_csharpstandard/standard/structs.md#16615-safe-context-constraint) in the C# language specification.
272272

273273
## Reference variables require a referent
274274

docs/csharp/language-reference/operators/equality-operators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public virtual bool Equals(T? other);
106106

107107
For more information, see the [Relational and type-testing operators](~/_csharpstandard/standard/expressions.md#1215-relational-and-type-testing-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md).
108108

109-
For more information about equality of record types, see the [Equality members](~/_csharpstandard/standard/classes.md#15162-equality-members) section of the [C# language specification](~/_csharpstandard/standard/README.md).
109+
For more information about equality of record types, see the [Equality members](~/_csharpstandard/standard/classes.md#151663-equality-members) section of the [C# language specification](~/_csharpstandard/standard/README.md).
110110

111111
## See also
112112

docs/csharp/language-reference/operators/with-expression.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ You can't customize the copy semantics for structure types.
3737
For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md):
3838

3939
- [`with` expression](~/_csharpstandard/standard/expressions.md#1210-with-expressions)
40-
- [Copy and Clone members](~/_csharpstandard/standard/classes.md#15163-copy-and-clone-members)
40+
- [Copy and Clone members](~/_csharpstandard/standard/classes.md#151664-copy-and-clone-members)
4141

4242
## See also
4343

docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,7 @@ f1_keywords:
216216
- "CS8381"
217217
- "CS8383"
218218
- "CS8384"
219-
# C# 8.0 diagnostics
220-
## Static local functions
221-
## Attributes
222-
## Index and range
223-
## Can't parse syntax
224-
## Default interface implementation
225-
## Patterns
226-
## Readonly struct members
227-
# Coming in C# 15
219+
# Coming in C# 15
228220
- "CS9343" # misc
229221
- "CS9347"
230222
- "CS9348"

docs/csharp/programming-guide/generics/constraints-on-type-parameters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ The preceding syntax would require implementers to use [explicit interface imple
169169
The `allows ref struct` anti-constraint declares that the corresponding type argument can be a [`ref struct`](../../language-reference/builtin-types/ref-struct.md) type. Instances of that type parameter must obey the following rules:
170170

171171
- It can't be boxed.
172-
- It participates in [ref safety rules](~/_csharpstandard/standard/structs.md#16515-safe-context-constraint).
172+
- It participates in [ref safety rules](~/_csharpstandard/standard/structs.md#16615-safe-context-constraint).
173173
- Instances can't be used where a `ref struct` type isn't allowed, such as `static` fields.
174174
- Instances can be marked with the `scoped` modifier.
175175

0 commit comments

Comments
 (0)