-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Closed
Copy link
Labels
4 - In ReviewA fix for the issue is submitted for review.A fix for the issue is submitted for review.Area-CompilersBugFeature - Nullable Reference TypesNullable Reference TypesNullable Reference Types
Milestone
Description
Version Used: d148f06
Steps to Reproduce:
#nullable enable
using System.Diagnostics.CodeAnalysis;
public class C
{
public void M0(string? x)
{
local(ref x);
void local([NotNull] ref string? x)
{
x = null;
} // no warning, but one was expected
}
void M1([NotNull] ref string? x)
{
x = null;
} // warning CS8777: Parameter 'x' must have a non-null value when exiting.
}Expected Behavior: Warnings on both member methods and local functions with [NotNull] parameters
Actual Behavior: No warning on local function
We need to call functions like enforceNotNull, enforceMemberNotNull etc. here:
| foreach (PendingBranch pending in pendingReturns) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
4 - In ReviewA fix for the issue is submitted for review.A fix for the issue is submitted for review.Area-CompilersBugFeature - Nullable Reference TypesNullable Reference TypesNullable Reference Types