dotnet / dotnet/csharpstandard

11.7.1 Exhaustive list of non-expression-tree lambdas?

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

Description

12.7.1 contains:

> Certain lambda expressions cannot be converted to expression tree types: Even though the conversion exists, it fails at compile-time. This is the case if the lambda expression:
> - Has a block body
> - Contains simple or compound assignment operators
> - Contains a dynamically bound expression
> - Is async

The wording suggests this is an exhaustive list. Is it intended to be? Can expression trees cope with pointer types etc? I thought there were various oddities which couldn't be expressed.

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.