dotnet / dotnet/csharpstandard

target typing vs (expr), checked(expr), and unchecked(expr)

Open
#288 1 comment 0 reactions 0 assignees View on GitHub
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

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.