facebook / facebook/hhvm

[Typechecker] Checking for `\HH\FunctionAttribute` and friends when used as an attribute fails on generic classes

Open
#8,583 1 comment 0 reactions 0 assignees View on GitHub
hack
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

### HHVM Version

```
HipHop VM 4.26.0 (rel)
Compiler: 1570480091_055726735
Repo schema: e24c730ecd4902e383877e9e82598459f02b76f6
```

### Operating System and Version

Irrelevant

### Standalone code, or other way to reproduce the problem

```HACK
class Anno implements \HH\FunctionAttribute{ }

<>
function func(): void{}
```

### Actual result

```
Typing[4231] The Anno attribute cannot be used on a function.
--> file.hack
1 | class Anno implements \HH\FunctionAttribute{ }
| ^^^^ The attribute's class is defined here. To be available for use on a function,
the Anno class must implement HH\FunctionAttribute.
3 | <>
| ^^^^

1 error found.
```

### Expected result

This is fine.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.