Skip to content
Permalink
Browse files

Update callable_types.md (#2482)

Spread operator must be a suffix in callables
  • Loading branch information
vudaltsov authored and muglug committed Dec 19, 2019
1 parent cc3df7d commit bb52c4ce752d3ac38c7392d2cb5c4dd78b0b43a5
Showing with 2 additions and 2 deletions.
  1. +2 −2 docs/annotating_code/type_syntax/callable_types.md
@@ -3,10 +3,10 @@
Psalm supports a special format for `callable`s of the form. It can also be used for annotating `Closure`.

```
callable(Type1, OptionalType2=, ...SpreadType3):ReturnType
callable(Type1, OptionalType2=, SpreadType3...):ReturnType
```

Adding `=` after the type implies it is optional, and prefixing with `...` implies the use of the spread operator.
Adding `=` after the type implies it is optional, and suffixing with `...` implies the use of the spread operator.

Using this annotation you can specify that a given function return a `Closure` e.g.

0 comments on commit bb52c4c

Please sign in to comment.
You can’t perform that action at this time.