nvim-treesitter/tests/query/highlights/hack/generics.hack

25 lines
521 B
Text
Raw Normal View History

class Box<T> {
// ^ type
// ^ type
protected T $data;
2022-11-20 15:14:25 +02:00
// ^ type.qualifier
// ^ type
public function __construct(T $data) {
// ^ type
// ^ parameter
// ^ keyword.function
2022-11-20 15:14:25 +02:00
// ^ type.qualifier
// ^ method
$this->data = $data;
}
public function getData(): T {
// ^ method
2022-11-20 15:14:25 +02:00
// ^ type.qualifier
return $this->data;
// ^ operator
// ^ variable.builtin
}
}