Skip to content

Commit f65e854

Browse files
committed
build fixes
1 parent 9407d0d commit f65e854

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

standard/expressions.md

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2844,36 +2844,6 @@ named_entity_target
28442844
;
28452845
```
28462846

2847-
### §throw-expression-operator-new-clause The throw expression operator
2848-
2849-
```antlr
2850-
throw_expression
2851-
: 'throw' null_coalescing_expression
2852-
;
2853-
```
2854-
2855-
A *throw_expression* throws the value produced by evaluating the *null_coalescing_expression*, which shall denote a value of the class type `System.Exception`, a value of a class type that derives from `System.Exception` or a value of a type parameter type that has `System.Exception` (or a subclass thereof) as its effective base class. If evaluation of the expression produces `null`, a `System.NullReferenceException` shall be thrown instead.
2856-
2857-
The behavior at runtime of the evaluation of a *throw expression* is the same as specified for a *throw statement* ([§13.10.6](expressions.md#13106-the-throw-statement)).
2858-
2859-
The type rules are as follows:
2860-
2861-
- A *throw_expression* has no type.
2862-
- A *throw_expression* is convertible to every type by an implicit conversion.
2863-
2864-
The flow-analysis rules are as follows:
2865-
2866-
- For every variable *v*, *v* is definitely assigned before the *null_coalescing_expression* of a *throw_expression* iff it is definitely assigned before the *throw_expression*.
2867-
- For every variable *v*, *v* is definitely assigned after *throw_expression*.
2868-
2869-
A *throw expression* shall only occur in the following syntactic contexts:
2870-
2871-
- As the second or third operand of a ternary conditional operator (`?:`), but not both.
2872-
- As the second operand of a null coalescing operator (`??`).
2873-
- As the body of an expression-bodied lambda or method.
2874-
2875-
## 12.8 Unary operators
2876-
28772847
Because `nameof` is not a keyword, a *nameof_expression* is always syntactically ambiguous with an invocation of the simple name `nameof`. For compatibility reasons, if a name lookup ([§11.7.4](expressions.md#1174-simple-names)) of the name `nameof` succeeds, the expression is treated as an *invocation_expression* — regardless of whether the invocation is valid. Otherwise it is a *nameof_expression*.
28782848

28792849
Simple name and member access lookups are performed on the *named_entity* at compile time, following the rules described in [§11.7.4](expressions.md#1174-simple-names) and [§11.7.6](expressions.md#1176-member-access). However, where the lookup described in [§11.7.4](expressions.md#1174-simple-names) and [§11.7.6](expressions.md#1176-member-access) results in an error because an instance member was found in a static context, a *nameof_expression* produces no such error.
@@ -2942,6 +2912,34 @@ These are the same transformations applied in [§6.4.3](lexical-structure.md#643
29422912
29432913
An *anonymous_method_expression* is one of two ways of defining an anonymous function. These are further described in [§11.16](expressions.md#1116-anonymous-function-expressions).
29442914
2915+
### §throw-expression-operator-new-clause The throw expression operator
2916+
2917+
```ANTLR
2918+
throw_expression
2919+
: 'throw' null_coalescing_expression
2920+
;
2921+
```
2922+
2923+
A *throw_expression* throws the value produced by evaluating the *null_coalescing_expression*, which shall denote a value of the class type `System.Exception`, a value of a class type that derives from `System.Exception` or a value of a type parameter type that has `System.Exception` (or a subclass thereof) as its effective base class. If evaluation of the expression produces `null`, a `System.NullReferenceException` shall be thrown instead.
2924+
2925+
The behavior at runtime of the evaluation of a *throw expression* is the same as specified for a *throw statement* ([§12.10.6](statements.md#12106-the-throw-statement)).
2926+
2927+
The type rules are as follows:
2928+
2929+
- A *throw_expression* has no type.
2930+
- A *throw_expression* is convertible to every type by an implicit conversion.
2931+
2932+
The flow-analysis rules are as follows:
2933+
2934+
- For every variable *v*, *v* is definitely assigned before the *null_coalescing_expression* of a *throw_expression* iff it is definitely assigned before the *throw_expression*.
2935+
- For every variable *v*, *v* is definitely assigned after *throw_expression*.
2936+
2937+
A *throw expression* shall only occur in the following syntactic contexts:
2938+
2939+
- As the second or third operand of a ternary conditional operator (`?:`), but not both.
2940+
- As the second operand of a null coalescing operator (`??`).
2941+
- As the body of an expression-bodied lambda or method.
2942+
29452943
## 11.8 Unary operators
29462944

29472945
### 11.8.1 General

0 commit comments

Comments
 (0)