-
Notifications
You must be signed in to change notification settings - Fork 217
Open
Labels
enhanced-constRequests or proposals about enhanced constant expressionsRequests or proposals about enhanced constant expressionsspecification
Description
Thanks to @sgrekhov for noticing this!
The definition of what it means to be in a constant context includes a case involving a function literal, here.
However, the situation which is described there can never occur: It is always a compile-time error for a function literal to occur in a constant context, because a function literal is never a constant expression.
This part of the rule is only relevant if we introduce a notion of constant function literals (see #1048 for a proposal ... from 2012 ... with about 250 supporting emojis).
We may wish to eliminate this part of the 'constant context' rule (or we may wish to add constant function literals). In any case, the current situation is somewhat confusing.
Metadata
Metadata
Assignees
Labels
enhanced-constRequests or proposals about enhanced constant expressionsRequests or proposals about enhanced constant expressionsspecification