dotnet / dotnet/csharpstandard
Lifted operators and default
Open
- Dominant language
- C#
- Stars
- 815
- Forks
- 99
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 16
Description
Consider:
```csharp
using System;
class C
{
// means ^default(int), not ^default(int?)
static Index? I => ^default;
// means I..default(Index), not I..default(Index?)
static Range? R => I..default;
// error CS8310: Operator '*' cannot be applied to operand 'default'
static int? K => ((int?)4) * default;
}
```
Is the apparent inconsistency justified or a “feature” of a particular implementation?
The above example is from this [discussion](https://github.com/dotnet/csharpstandard/pull/1369/files#r2240774346) which ends with “Defer to a new issue”.
Contributor guide
Assessment
This issue has not been assessed yet.