Skip to content

[C# diagnostics] - Expression-form context restrictions #55339

Description

@BillWagner

Describe the issue or suggestion

Impacted diagnostics:

Code Actual message text What triggers it Feature
CS8115 A throw expression is not allowed in this context. A throw expression appears outside the contexts where C# permits throw expressions. Throw expressions
CS8185 A declaration is not allowed in this context. A declaration expression appears where the grammar/binder forbids it. Expression variables
CS8188 An expression tree may not contain a throw-expression. An expression tree lambda contains a throw expression. Expression trees / throw expressions
CS8209 A value of type 'void' may not be assigned. Source attempts to assign the result of a void expression. Expression binding
CS8310 Operator '{0}' cannot be applied to operand '{1}' null, default, or new is used with an operator that has no valid operand binding. Default literal / typeless expressions
CS8312 Use of default literal is not valid in this context The default literal appears without a target type or in another invalid context. Default literal

Associated WorkItem - 607281

Metadata

Metadata

Assignees

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.

Type

No type

Projects

Status
🔖 Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions