Skip to content

Commit 06800d6

Browse files
authored
Adjust objectPattern to allow Function() (#3496)
Adjust objectPattern to allow `Function(...)` and `prefix.Function(...)`. This is already the implemented behavior, which means that there is no implementation effort associated with this specification change.
1 parent 1a16815 commit 06800d6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

accepted/3.0/patterns/feature-specification.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,9 @@ pattern with the field name omitted (see name inference below).
740740
### Object pattern
741741

742742
```
743-
objectPattern ::= typeName typeArguments? '(' patternFields? ')'
743+
objectPattern ::=
744+
(typeName typeArguments? | (typeIdentifier '.')? 'Function')
745+
'(' patternFields? ')'
744746
```
745747

746748
An object pattern matches values of a given named type and then extracts values
@@ -1924,7 +1926,7 @@ To type check a pattern `p` being matched against a value of type `M`:
19241926
performed. Otherwise *(when `M` is not `dynamic` or `Never`)*:
19251927

19261928
1. A compile-time error occurs if `M` does not have an operator `op`,
1927-
and there is no available and applicable extension operator `op`.
1929+
and there is no available and applicable extension operator `op`.
19281930
Let `A` be the type of the formal parameter of the given operator
19291931
declaration, and let `R` be the return type.
19301932

@@ -3550,6 +3552,11 @@ Here is one way it could be broken down into separate pieces:
35503552
35513553
## Changelog
35523554
3555+
### 2.34 (after shipping)
3556+
3557+
- Adjust `objectPattern` to allow `Function(...)`, which is already
3558+
the implemented behavior (#3468).
3559+
35533560
### 2.33 (after shipping)
35543561
35553562
- Tweak caching of trailing list elements after a rest element. The specified

0 commit comments

Comments
 (0)