dotnet / dotnet/csharpstandard

12.13.3 User-defined conditional logical operators vs nullable types

Open
#171 1 comment 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
C#
Stars
815
Forks
99
Avg merge
1d 14h
Merged PRs (30d)
16

Description

This is taken from ECMA-TC49-TG2/spec#920 but that talks about `Nullable` as well, which isn't a problem. This issue is just about nullable user-defined types with appropriate operators defined.

---

See also dotnet/roslyn#14098 for examples.

The spec isn't clear what is supposed to happen when a short-circuit operator && or || is used with an expression of a nullable user-defined type.

---

Basically, either 13.13.1 needs to prohibit `&&` and `||` operating over nullable user-defined types (as it does for `Nullable`), or 13.13.13 needs to say how it's handled.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.