Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion standard/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
;

class_tag
: 'class'
: 'record'? 'class'
| 'record'
;
```
Expand All @@ -33,6 +33,8 @@

If *class_tag* contains `record`, that class is a ***record class***; otherwise, it is a ***non-record class***.

The *class_tag*s `record` and `record class` are equivalent.

For a record class, *class_modifier* shall not be `static`.

*delimited_parameter_list* shall not be present in a non-record class.
Expand Down Expand Up @@ -422,7 +424,7 @@
: 'where' type_parameter ':' type_parameter_constraints
;

type_parameter_constraints

Check warning on line 427 in standard/classes.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/classes.md#L427

MDC032::Line length 83 > maximum 81
: primary_constraint (',' secondary_constraints)? (',' constructor_constraint)?
| secondary_constraints (',' constructor_constraint)?
| constructor_constraint
Expand Down Expand Up @@ -534,15 +536,15 @@
> static void M()
> {
> // nonnull constraint allows nonnullable struct type argument
> A<int> x1;

Check warning on line 539 in standard/classes.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/classes.md#L539

MDC032::Line length 87 > maximum 81
> // possible warning: nonnull constraint prohibits nullable struct type argument
> A<int?> x2;
> // nonnull constraint allows nonnullable class type argument
> A<C> x3;

Check warning on line 543 in standard/classes.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/classes.md#L543

MDC032::Line length 86 > maximum 81
> // possible warning: nonnull constraint prohibits nullable class type argument
> A<C?> x4;

Check warning on line 545 in standard/classes.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/classes.md#L545

MDC032::Line length 84 > maximum 81
> // nonnullable base class requirement allows nonnullable class type argument
> B1<C> x5;

Check warning on line 547 in standard/classes.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/classes.md#L547

MDC032::Line length 82 > maximum 81
> // possible warning: nonnullable base class requirement prohibits nullable
> // class type argument
> B1<C?> x6;
Expand Down Expand Up @@ -3556,7 +3558,7 @@
> static void Main()
> {
> field = 10;
> Console.WriteLine(Property); // Prints 10

Check warning on line 3561 in standard/classes.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/classes.md#L3561

MDC032::Line length 83 > maximum 81
> Property = 20; // This invokes the get accessor, then assigns
> // via the resulting variable reference
> Console.WriteLine(field); // Prints 20
Expand Down Expand Up @@ -4917,7 +4919,7 @@
: '!'
;

overloadable_unary_operator

Check warning on line 4922 in standard/classes.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/classes.md#L4922

MDC032::Line length 82 > maximum 81
: '+' | '-' | logical_negation_operator | '~' | '++' | '--' | 'true' | 'false'
;

Expand Down Expand Up @@ -6134,7 +6136,7 @@
> public static bool operator!=(R1? left, R1? right) => !(left == right);
>
> public override int GetHashCode()
> {

Check warning on line 6139 in standard/classes.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/classes.md#L6139

MDC032::Line length 93 > maximum 81
> return HashCode.Combine(EqualityComparer<Type>.Default.GetHashCode(EqualityContract),
> EqualityComparer<T1>.Default.GetHashCode(P1));
> }
Expand Down Expand Up @@ -6315,7 +6317,7 @@
> protected virtual bool PrintMembers(StringBuilder builder)
> {
> builder.Append(nameof(P1));
> builder.Append(" = ");

Check warning on line 6320 in standard/classes.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/classes.md#L6320

MDC032::Line length 97 > maximum 81
> builder.Append(this.P1); // or builder.Append(this.P1.ToString()); if P1 has a value type
> return true;
> }
Expand Down Expand Up @@ -6346,11 +6348,11 @@
> builder.Append(", ");
> }
> builder.Append(nameof(P2));
> builder.Append(" = ");

Check warning on line 6351 in standard/classes.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/classes.md#L6351

MDC032::Line length 86 > maximum 81
> builder.Append(this.P2); // or builder.Append(this.P2); if P2 has a value type
> builder.Append(", ");
> builder.Append(nameof(P3));
> builder.Append(" = ");

Check warning on line 6355 in standard/classes.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/classes.md#L6355

MDC032::Line length 86 > maximum 81
> builder.Append(this.P3); // or builder.Append(this.P3); if P3 has a value type
> return true;
> }
Expand Down Expand Up @@ -6484,5 +6486,5 @@
>
> *end example*


Check failure on line 6489 in standard/classes.md

View workflow job for this annotation

GitHub Actions / lint

Multiple consecutive blank lines

standard/classes.md:6489 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md012.md

Check failure on line 6490 in standard/classes.md

View workflow job for this annotation

GitHub Actions / lint

Multiple consecutive blank lines

standard/classes.md:6490 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 3] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md012.md
Loading