diff options
Diffstat (limited to 'tests/query/highlights/hack/generics.hack')
| -rw-r--r-- | tests/query/highlights/hack/generics.hack | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/query/highlights/hack/generics.hack b/tests/query/highlights/hack/generics.hack new file mode 100644 index 000000000..ea605420c --- /dev/null +++ b/tests/query/highlights/hack/generics.hack @@ -0,0 +1,23 @@ +class Box<T> { + // ^ type + // ^ type + protected T $data; + // ^ keyword + // ^ type + + public function __construct(T $data) { + // ^ type + // ^ parameter + // ^ keyword + // ^ method + $this->data = $data; + } + + public function getData(): T { + // ^ method + // ^ keyword + return $this->data; + // ^ operator + // ^ variable.builtin + } +} |
