nvim-treesitter/tests/query/highlights/hack/generics.hack
2022-01-17 10:53:35 +01:00

24 lines
500 B
Text

class Box<T> {
// ^ type
// ^ type
protected T $data;
// ^ keyword
// ^ type
public function __construct(T $data) {
// ^ type
// ^ parameter
// ^ keyword.function
// ^ keyword
// ^ method
$this->data = $data;
}
public function getData(): T {
// ^ method
// ^ keyword
return $this->data;
// ^ operator
// ^ variable.builtin
}
}