dotnet / dotnet/csharpstandard
12.13.3 User-defined conditional logical operators vs nullable types
Open
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
Assessment
This issue has not been assessed yet.