Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion standard/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3034,7 +3034,8 @@ Partial methods shall not define access modifiers; they are implicitly private.

There are two kinds of partial method declarations: If the body of the method declaration is a semicolon, the declaration is said to be a ***defining partial method declaration***. If the body is other than a semicolon, the declaration is said to be an ***implementing partial method declaration***. Across the parts of a type declaration, there shall be only one defining partial method declaration with a given signature, and there shall be at most only one implementing partial method declaration with a given signature. If an implementing partial method declaration is given, a corresponding defining partial method declaration shall exist, and the declarations shall match as specified in the following:

- The declarations shall have the same modifiers (although not necessarily in the same order), method name, number of type parameters and number of parameters.
- The declarations shall have the same method name, number of type parameters, and number of parameters.
- The declarations shall have the same modifiers (although not necessarily in the same order), with the exception of the `async` modifier which shall not appear on a defining part.
- Corresponding parameters in the declarations shall have the same modifiers (although not necessarily in the same order) and the same types, or identity convertible types (modulo differences in type parameter names).
- Corresponding type parameters in the declarations shall have the same constraints (modulo differences in type parameter names).

Expand Down
31 changes: 27 additions & 4 deletions standard/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -869,10 +869,13 @@ Every expression has one of three ***null state***s:

The ***default null state*** of an expression is determined by its type, and the state of the annotations flag when it is declared:

- The default null state of a nullable reference type is:
- Maybe null when its declaration is in text where the annotations flag is enabled.
- Not null when its declaration is in text where the annotations flag is disabled.
- The default null state of a non-nullable reference type is not null.
- The default state of the `null` literal ([§6.4.5.7](lexical-structure.md#6457-the-null-literal)) is maybe null.
- The default state of a default value expression ([§12.8.21](expressions.md#12821-default-value-expressions)) is not null when the type is a non-nullable value type, otherwise maybe null.
- For all other expressions:
- The default null state of an expression whose type is a nullable reference type is:
- Maybe null when its declaration is in text where the annotations flag is enabled.
- Not null when its declaration is in text where the annotations flag is disabled.
- The default null state of an expression whose type is a non-nullable reference type is not null.

> *Note:* The *maybe default* state is used with unconstrained type parameters when the type is a non-nullable type, such as `string` and the expression `default(T)` is the null value. Because null is not in the domain for the non-nullable type, the state is maybe default. *end note*

Expand Down Expand Up @@ -1168,4 +1171,24 @@ A compiler may issue a warning when nullability differs in either direction in t
>
> *end example*

A compiler may issue a warning when the result of a lifted conversion operator ([§10.6.2](conversions.md#1062-lifted-conversions)) is a reference type and is converted to a non-nullable reference type, since the result of a lifted conversion operator is maybe-null.

> <!-- Example: {template:"code-in-class-lib", name:"LiftedOperator", ignoredWarnings:["CS8600"]} -->
> ```csharp
> #nullable enable
> class C
> {
> void M()
> {
> C? a = (int?)null; // No warning
> C b = (int?)null; // Warning: Possible assignment to null
> C c = 1; // No warning
> }
>
> public static implicit operator C(int v) => new C();
> }
> ```
>
> *end example*

**End of conditionally normative text**
6 changes: 3 additions & 3 deletions tools/ExampleTester.Tests/ExampleTester.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.10.0" PrivateAssets="all" />
<PackageReference Include="NUnit3TestAdapter" Version="5.1.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.11.2" PrivateAssets="all" />
<PackageReference Include="NUnit3TestAdapter" Version="6.0.1" />
<PackageReference Include="Shouldly" Version="4.3.0" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions tools/MarkdownConverter.Tests/MarkdownConverter.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="XMLUnit.Core" Version="2.11.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down