dotnet / dotnet/csharpstandard
target typing vs (expr), checked(expr), and unchecked(expr)
Open
- Dominant language
- C#
- Stars
- 815
- Forks
- 99
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 16
Description
The language spec does not explain the apparent interaction of parenthesized expressions with target typing. For example, in the code
``` c#
var add = (Func)((x, y) => x + y);
```
The code should, by a pedantic reading of the spec, be an error because the lambda expression is not subject to a conversion. Rather, its enclosing parenthesized expression is subject to a conversion.
Contributor guide
Assessment
This issue has not been assessed yet.