Hack: No way to write generic function type
- Dominant language
- C++
- Stars
- 18.7k
- Forks
- 3.1k
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 2
Description
### HHVM Version
```
HipHop VM 3.15.2 (rel)
Compiler: tags/HHVM-3.15.2-0-g83ac3e5e3f5657be0cf4c55884044f86a7818b90
Repo schema: 608339137764e8365964a1adaa7a27d125b6076f
```
### Standalone code, or other way to reproduce the problem
``` hack
// Interface for things that must be producible from one of many possible inputs
interface Producer<+T> {
public function fromFoo(Foo $foo): T;
public function fromBar(Bar $bar): T;
public function fromXmlString(string $xml): T;
public function fromJsonString(string $json): T;
// ...
}
// The input to a Producer then is a function that accepts a Producer and
// returns a value produced by the Producer.
type producer_input = (function (Producer $p): T);
```
### Expected result
No errors.
### Actual result
Syntax error in definition of `producer_input`: `Expected (`.

This was originally posted on Stack Overflow [here](https://stackoverflow.com/questions/38771190/how-to-write-generic-function-type).
Contributor guide
Assessment
This issue has not been assessed yet.