Skip to content

Commit 3c2957c

Browse files
authored
Specify that implicit call tear-offs are supported for extension types (#3591)
Add a rule to say that implicit `call` tear-offs are supported for extension types.
1 parent d4813d5 commit 3c2957c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

accepted/future-releases/extension-types/feature-specification.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,14 @@ in particular that `V` must match the on-type of the extension
10001000
*(again, this is an `extension` declaration that we have today, not an
10011001
`extension type` declaration)*.
10021002

1003+
Let `e` be an expression whose static type is an extension type that has a
1004+
method named `call`. In the case where the context type for `e` is a function
1005+
type or the type `Function`, `e` is treated as `e.call`.
1006+
1007+
*In other words, an implicit `call` tear-off is supported for extension
1008+
types in the same way as it is supported for a type which is introduced by
1009+
the declaration of a class, mixin, enum, or mixin class.*
1010+
10031011
*In the body of an extension type declaration _DV_ with name `Name`
10041012
and type parameters
10051013
<code>X<sub>1</sub>, .. X<sub>s</sub></code>, for an invocation like

0 commit comments

Comments
 (0)