dotnet / dotnet/csharpstandard
10.4.4.29 [definite assignment for] ?? expressions
Open
type: bug
- Dominant language
- C#
- Stars
- 815
- Forks
- 99
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 16
Description
The following test case should “pass” to match compilers:
``` cs
using System;
static class Program
{
static void Main()
{
const string x = "pass";
string y;
string z = x ?? y;
Console.WriteLine(z);
}
}
```
However, this is not justified by the current language specification. I recommend we modify the specification to allow this.
Contributor guide
Assessment
This issue has not been assessed yet.