language
stringlengths
0
24
filename
stringlengths
9
214
code
stringlengths
99
9.93M
PHP
hhvm/hphp/hack/test/holes/foreach_kv_union_int_dynamic.php
<?hh function foreach_kv_union_int_dynamic((int|dynamic) $xs): void { /* HH_FIXME[4110] */ foreach ($xs as $k => $v) { } }
PHP
hhvm/hphp/hack/test/holes/foreach_non_traversable.php
<?hh function foreach_non_traversable(int $xs): void { /* HH_FIXME[4110] */ foreach ($xs as $x) { } }
PHP
hhvm/hphp/hack/test/holes/foreach_nullable.php
<?hh function foreach_nullable(?vec<int> $xs) : void { $y = 0; /* HH_FIXME[4110] */ foreach($xs as $x) { $y += $x; } }
PHP
hhvm/hphp/hack/test/holes/foreach_union_int_dynamic.php
<?hh function foreach_union_int_dynamic((int|dynamic) $xs): void { /* HH_FIXME[4110] */ foreach ($xs as $x) { } }
hhvm/hphp/hack/test/holes/HH_FLAGS
--allowed-fixme-codes-strict 2084,4005,4006,4011,4026,4053,4062,4063,4064,4067,4090,4101,4110,4116,4135,4240,4298,4323,4324,4343,4370,4371,4414,4415,4417,4423,4435,4438 --allowed-decl-fixme-codes 2084,4101 --union-intersection-type-hints --enable-strict-string-concat-interp
PHP
hhvm/hphp/hack/test/holes/imprecise_cast.php
<?hh class Super {} class Sub extends Super {} function imprecise_cast(): num { $b = new Sub(); /* HH_FIXME[4417] */ return \HH\FIXME\UNSAFE_CAST<Super,int>($b); }
PHP
hhvm/hphp/hack/test/holes/keyset_lit.php
<?hh function keyset_lit(): void { /* HH_FIXME[4110] */ $x = keyset[1, true]; } function keyset_lit_string_opt(?string $x) : void { /* HH_FIXME[4110] */ $y = keyset[$x]; }
PHP
hhvm/hphp/hack/test/holes/keyvalue_collection_lit.php
<?hh function keyvalue_collection_lit():dict<int,int> { /* HH_FIXME[4110] */ return dict [ 'bad' => 1, 1 => 2]; }
PHP
hhvm/hphp/hack/test/holes/member_not_found_method.php
<?hh class C {} function member_not_found_method(C $c): void { /* HH_FIXME[4053] */ $c->does_not_exist(); }
PHP
hhvm/hphp/hack/test/holes/member_not_found_property.php
<?hh class C {} function member_not_found_property_fixme(C $c) : void { /* HH_FIXME[4053] */ $c->does_not_exist; } function member_not_found_property_no_fixme(C $c) : void { $c->does_not_exist; }
PHP
hhvm/hphp/hack/test/holes/non_object_member_read_generic.php
<?hh class C<T> { public function non_object_member_read_generic(T $x): void { /* HH_FIXME[4062] */ $x->bar(); } }
PHP
hhvm/hphp/hack/test/holes/non_object_member_read_intersection.php
<?hh function non_object_member_read_method_intersection((int & arraykey) $xs) : void { /* HH_FIXME[4062] */ $xs->c(); }
PHP
hhvm/hphp/hack/test/holes/non_object_member_read_method.php
<?hh function non_object_member_read_method(nonnull $xs) : void { /* HH_FIXME[4062] */ $xs->c(); }
PHP
hhvm/hphp/hack/test/holes/non_object_member_read_property.php
<?hh function non_object_member_read_property(nonnull $xs) : void { /* HH_FIXME[4062] */ $xs->c; }
PHP
hhvm/hphp/hack/test/holes/non_object_member_read_union.php
<?hh function non_object_member_read_method_union((int | bool) $xs) : void { /* HH_FIXME[4062] */ $xs->c(); }
PHP
hhvm/hphp/hack/test/holes/null_member_read_method.php
<?hh function null_member_read_method_null(null $xs) : void { /* HH_FIXME[4064] */ $xs->c(); } function null_member_read_method_nullable(?string $xs) : void { /* HH_FIXME[4064] */ $xs->c(); } function null_member_read_method_mixed(mixed $xs) : void { /* HH_FIXME[4064] */ $xs->c(); }
PHP
hhvm/hphp/hack/test/holes/null_member_read_nullable.php
<?hh class MyVeryOwnC { public function __construct(public int $x) {} public function bar(): void {} } function null_member_read_nullable(bool $a): void { $c = $a ? null : new MyVeryOwnC(0); /* HH_FIXME[4064] */ $c->x; /* HH_FIXME[4064] */ $c->bar(); }
PHP
hhvm/hphp/hack/test/holes/null_member_read_property.php
<?hh function null_member_read_property_null(null $xs) : void { /* HH_FIXME[4064] */ $xs->c; } function null_member_read_property_nullable(?string $xs) : void { /* HH_FIXME[4064] */ $xs->c; } function null_member_read_property_mixed(mixed $xs) : void { /* HH_FIXME[4064] */ $xs->c; }
PHP
hhvm/hphp/hack/test/holes/pair_lit.php
<?hh function pair_lit():Pair<int,string> { /* HH_FIXME[4110] */ return Pair{'bad', 'good'}; }
PHP
hhvm/hphp/hack/test/holes/return_awaitable_void.php
<?hh async function err(string $x): Awaitable<void> {} async function f(): Awaitable<int> { return 1; } async function g(?string $x): Awaitable<int> { if ($x === null) { return await f(); } /* HH_FIXME[4110] */ return await err($x); }
PHP
hhvm/hphp/hack/test/holes/return_refinement.php
<?hh function return_refinement():bool { $x = 3; if(true) { /* HH_FIXME[4110] */ return $x; } else { return $x; } }
PHP
hhvm/hphp/hack/test/holes/return_sync.php
<?hh function return_sync(): Pair<int, bool> { $x = Pair {2, 'true'}; /* HH_FIXME[4110] */ return $x; }
PHP
hhvm/hphp/hack/test/holes/unsafe_cast_flow_typing.php
<?hh function some_condition(int $_): bool { return true; } function flow_typing_example(): void { if (3 !== 2 || some_condition(HH\FIXME\UNSAFE_CAST<bool, int>(false))) { } }
PHP
hhvm/hphp/hack/test/holes/value_collection_lit.php
<?hh function value_collection_lit():keyset<int> { /* HH_FIXME[4110] */ return keyset [ 'bad' , 1 ]; }
PHP
hhvm/hphp/hack/test/holes/xhp_simple_attribute.php
<?hh namespace XhpSimple { class :element { attribute int prop @required; public function __construct( public darray<string, dynamic> $attributes, public varray<dynamic> $children, public string $file, public int $line, ) {} } function xhp_simple_attribute(string $prop): void { /* HH_FIXME[4343] */ $elem = <element prop={$prop} />; } }
PHP
hhvm/hphp/hack/test/holes/xhp_spread_attribute.php
<?hh namespace XhpSpread { class :element { attribute int prop1; attribute int prop3; public function __construct( public darray<string, dynamic> $attributes, public varray<dynamic> $children, public string $file, public int $line, ) {} } class :element2 { attribute string prop1; attribute int prop2; public function __construct( public darray<string, dynamic> $attributes, public varray<dynamic> $children, public string $file, public int $line, ) {} } function xhp_spread_attribute(:element2 $props): void { /* HH_FIXME[4343] */ $elem = <element {...$props} />; } }
PHP
hhvm/hphp/hack/test/hover/async_block.php
<?hh async function foo(): Awaitable<void> { await async { // ^ hover-at-caret return 1; }; }
PHP
hhvm/hphp/hack/test/hover/attribute.php
<?hh class Foo { <<__Memoize>> // ^ hover-at-caret public function bar(): int { return 0; } }
PHP
hhvm/hphp/hack/test/hover/await_keyword.php
<?hh async function bar(): Awaitable<void> {} async function foo(): Awaitable<void> { await bar(); // ^ hover-at-caret }
hhvm/hphp/hack/test/hover/await_keyword.php.imp_pess_exp
~void `await` waits for the result of an `Awaitable<_>` value. This does not give you threads. Only one function is running at any point in time. Instead, the runtime may switch to another function at an `await` expression, and come back to this function later. This allows data fetching (e.g. database requests) to happen in parallel.
PHP
hhvm/hphp/hack/test/hover/built_in_type_as_param.php
<?hh function foo(): vec<arraykey> { // ^ hover-at-caret throw new Exception(); }
PHP
hhvm/hphp/hack/test/hover/built_in_type_shape_param.php
<?hh function foo(shape('x' => int, ...) $s): void { // ^ hover-at-caret throw new Exception(); }
PHP
hhvm/hphp/hack/test/hover/built_in_type_this.php
<?hh class MyClass { public function foo(): this { // ^ hover-at-caret throw new Exception(); } }
PHP
hhvm/hphp/hack/test/hover/class_attribute.php
<?hh // I am a comment on MyAttribute. class MyAttribute implements HH\ClassAttribute { } <<MyAttribute>> // ^ hover-at-caret class Foo { public function bar(): int { return 0; } }
PHP
hhvm/hphp/hack/test/hover/class_const_expr.php
<?hh class Foo { /** A doc comment. */ const BAR = 1; } function use_it(): void { $x = Foo::BAR; // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/concurrent_keyword.php
<?hh async function bar(): Awaitable<void> {} async function foo(): Awaitable<void> { concurrent { // ^ hover-at-caret await bar(); await bar(); } }
PHP
hhvm/hphp/hack/test/hover/constructor_call.php
<?hh class FooParent { public function __construct() {} } class Foo extends FooParent { } function call_construct(): void { new Foo(); // ^ hover-at-caret }
hhvm/hphp/hack/test/hover/ctx.php.imp_pess_exp
// Defined in namespace C function any<T>( Traversable<int> $traversable, ?(function(int): ~bool) $predicate = _ )[ctx $predicate]: bool Returns true if the given predicate returns true for any element of the given Traversable. If no predicate is provided, it defaults to casting the element to bool. If the Traversable is empty, it returns false. If you're looking for `C\none`, use `!C\any`. Time complexity: O(n) Space complexity: O(1)
PHP
hhvm/hphp/hack/test/hover/diamond_trait.php
<?hh trait MyTrait1 { public function testFun(): void {} } trait MyTrait2 { use MyTrait1; } <<__EnableMethodTraitDiamond>> // ^ hover-at-caret class MyClass { use MyTrait1; use MyTrait2; }
PHP
hhvm/hphp/hack/test/hover/docblock_copyright_comment.php
<?hh // ACME Inc. function foo(): void {} function call_it(): void { // Should not show the file header when hovering here. foo(); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/docblock_delimited_comment.php
<?hh /** * This function does stuff. */ function foo(): void {} function call_it(): void { // Should show the delimiter comment despite the gap. foo(); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/docblock_hhfixme_after.php
<?hh // This function does stuff. /* HH_FIXME[4410] Shameful fixme. */ function foo(): void {} function call_it(): void { foo(); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/docblock_line_comment.php
<?hh // This file does stuff. // This function does stuff. // // More doc info here. function foo(): void {} function call_it(): void { foo(); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/docs_url_enum.php
<?hh <<__Docs("http://example.com")>> enum Foo: string as string {} function takes_foo(Foo $f): void {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/docs_url_enum_class.php
<?hh <<__Docs("http://example.com")>> enum class Foo: mixed { int X = 1; } function bar(): void { Foo::X; // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/docs_url_enum_class_hash.php
<?hh <<__Docs("http://example.com")>> enum class Foo: mixed { int X = 1; } function bar(): void { Foo#X; // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/docs_url_inherited.php
<?hh <<__Docs("http://example.com")>> class Foo {} class FooChild extends Foo {} function takes_foochild(FooChild $f): void {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/docs_url_interface.php
<?hh <<__Docs("http://example.com")>> class IFoo {} class FooChild implements IFoo {} function takes_foochild(FooChild $f): void {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/docs_url_namespace.php
<?hh namespace Bar; <<__Docs("http://example.com")>> class Foo {} function takes_foo(Foo $f): void {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/docs_url_newtype.php
<?hh <<__Docs("http://example.com")>> newtype Foo = string; function takes_foo(Foo $f): void {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/docs_url_prefer_child.php
<?hh <<__Docs("http://example.com")>> class Foo {} <<__Docs("http://example.com/foochild")>> class FooChild extends Foo {} function takes_foochild(FooChild $f): void {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/docs_url_trait.php
<?hh <<__Docs("http://example.com")>> class TraitFoo {} class Foo { use TraitFoo; } function takes_foo(Foo $f): void {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/docs_url_type.php
<?hh <<__Docs("http://example.com")>> type Foo = string; function takes_foo(Foo $f): void {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/docs_url_type_hint.php
<?hh <<__Docs("http://example.com")>> class Foo {} function takes_foo(Foo $f): void {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/docs_url_with_doc_comment.php
<?hh /** * The Foo class does stuff. */ <<__Docs("http://example.com")>> class Foo {} function takes_foo(Foo $f): void {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/enum_class.php
<?hh enum class Foo: mixed { /** Hello */ int BAR = 1; } function demo(): void { $value = Foo#BAR; // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/enum_class_receiver.php
<?hh /** Doc comment here. */ enum class MyEnumClass: int { int RED = 1; int GREEN = 2; int BLUE = 3; } function use_it(): void { $x = MyEnumClass#RED; // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/enum_receiver.php
<?hh /** Doc comment here. */ enum MyEnum: int { RED = 1; GREEN = 2; BLUE = 3; } function use_it(): void { $x = MyEnum::RED; // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/expression_tree.php
<?hh <<file:__EnableUnstableFeatures('expression_trees')>> function foo(): void { ExampleDsl`"abcd"`; // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/expression_tree_call.php
<?hh <<file:__EnableUnstableFeatures('expression_trees')>> async function bar( ExampleContext $_, ): Awaitable<ExprTree<ExampleDsl, ExampleDsl::TAst, (function(ExampleString): ExampleInt)>> { throw new Exception(); } function foo(): void { ExampleDsl`bar("abc")`; // ^ hover-at-caret }
hhvm/hphp/hack/test/hover/expression_tree_call.php.imp_pess_exp
async function bar(ExampleContext $_): Awaitable< ~ExprTree< ExampleDsl, mixed, (function(ExampleString): ~ExampleInt) > >
PHP
hhvm/hphp/hack/test/hover/expression_tree_hint.php
<?hh <<file:__EnableUnstableFeatures('expression_trees')>> function foo(): void { ExampleDsl`"abcd"`; // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/expression_tree_splice.php
<?hh <<file:__EnableUnstableFeatures('expression_trees')>> function foo(): void { // I am a comment associated with $one. $one = ExampleDsl`1`; $one_splice = ExampleDsl`${$one}`; // ^ hover-at-caret }
hhvm/hphp/hack/test/hover/expression_tree_splice.php.imp_pess_exp
class ExampleDsl where TInfer#1 = ExampleInt An example DSL for testing expression trees (ETs). Any class can be used an an expression tree visitor. It needs to implement the methods shown here, and expression tree literals MyClass`...` will be converted (at compile time) to calls on these methods. This .hhi file is only used when testing the type checker. Otherwise every test file would need to include a class with all these methods.
PHP
hhvm/hphp/hack/test/hover/function_call.php
<?hh /** * Adds one to the argument. */ function add_one(int $x): int { return $x + 1; } function call_it(): void { $y = add_one(42); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/function_generic.php
<?hh // (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. function identity<T>(T $x, mixed $_):T { return $x; } function testit():void { $x = identity(3, "A"); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/function_in_namespace.php
<?hh function call_it(vec<int> $v): void { $y = HH\Lib\C\count($v); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/function_with_default.php
<?hh function add_one(int $x = 0): int { return $x + 1; } function call_it(): void { $y = add_one(42); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/global_const.php
<?hh /** A doc comment. */ const int BAR = 1; function use_it(): void { $x = BAR; // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/hh_class_name.php
<?hh class HH_FOO {} // ^ hover-at-caret // This should show HH_FOO, not _FOO. This isn't an occurrence of the \HH\ namespace.
PHP
hhvm/hphp/hack/test/hover/imemoizeparam.php
<?hh abstract class MyClass implements IMemoizeParam {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/internal_keyword_class.php
//// modules.php <?hh <<file:__EnableUnstableFeatures("modules")>> new module foo {} //// test.php <?hh <<file:__EnableUnstableFeatures("modules")>> module foo; internal class Foo {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/internal_keyword_method.php
//// modules.php <?hh <<file:__EnableUnstableFeatures("modules")>> new module foo {} //// test.php <?hh <<file:__EnableUnstableFeatures("modules")>> module foo; class Foo { internal function callFoo(): void { // ^ hover-at-caret echo "callFoo"; } }
PHP
hhvm/hphp/hack/test/hover/internal_method_call.php
internal class A { internal function bar(): void {} internal function baz(): void { $this->bar(); // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/invariant.php
<?hh function foo(int $x): void { invariant($x === 1, "Expected x to be one!"); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/local_var_lambda.php
<?hh function takes_lambda((function(int): int) $f): void {} function foo(): void { takes_lambda(() ==> { $x = 1; // ^ hover-at-caret return $x + 1; }); }
hhvm/hphp/hack/test/hover/memoize_param.php.imp_pess_exp
HH\EnumClass\Label< HH\MemoizeOption, ~string > HH\MemoizeOption#KeyedByIC Incorporate the Implicit Context state into the memoization cache key.
PHP
hhvm/hphp/hack/test/hover/method.php
<?hh class Foo { /** Do stuff. */ public function bar(): int { return 0; } // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/method_attribute.php
<?hh /** * I am the doc comment for MyAttribute. */ class MyAttribute implements HH\MethodAttribute { } class Foo { <<__Memoize, MyAttribute>> // ^ hover-at-caret public function bar(): int { return 0; } }
PHP
hhvm/hphp/hack/test/hover/method_call.php
<?hh class FooParent { public function bar(): void {} } class Foo extends FooParent { public function callIt(): void { $this->bar(); // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/method_call_nonexistent.php
<?hh class Foo { public function callIt(): void { $this->noSuchFunc(); // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/method_call_sdt.php
<?hh <<__SupportDynamicType>> class FooParent { public function bar(): void {} } <<__SupportDynamicType>> class Foo extends FooParent { public function callIt(): void { $this->bar(); // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/method_call_union.php
<?hh class FooParent { public function bar(): string { return "A"; } } class Other { public function bar(): int { return 3; } } class Foo extends FooParent { public function callIt(Other $obj, bool $b): void { if ($b) $obj = $this; $obj->bar(); // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/method_call_vec.php
<?hh class FooParent { public function bar(): void {} } function getVec():vec<FooParent> { return vec[]; } class Foo extends FooParent { public function callIt(): void { $v = getVec(); $v[0]->bar(); // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/method_property_same_name.php
<?hh class MyClass { // I am a property. private (function(): void) $foo; public function __construct((function(): void) $foo) { $this->foo = $foo; } // I am a method. private function foo(): void { // This is using the property, not the method. ($this->foo)(); // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/named_param_constructor.php
<?hh class Foo { public function __construct(int $x): void {} } function call_it(): void { new Foo(42); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/named_param_function.php
<?hh function add_one(int $x, float $y): int { return $x + 1; } function call_it(): void { $y = add_one(42, 1.0); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/named_param_inst_meth.php
<?hh class Foo { public function doStuff(int $x): void {} } function call_it(Foo $f): void { $f->doStuff(42); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/named_param_parent_constructor.php
<?hh class Foo { public function __construct(int $x): void {} } class FooChild extends Foo { public function __construct(int $y): void {} public static function newInstance(): void { new parent(42); // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/named_param_self_constructor.php
<?hh class Foo { public function __construct(int $x): void {} public static function newInstance(): void { new self(42); // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/named_param_static_meth.php
<?hh class Foo { public static function doStuff(int $x): void {} } function call_it(): void { Foo::doStuff(42); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/named_param_static_meth_lsb.php
<?hh class Foo { public static function doStuff(int $x): void {} public static function callIt(): void { static::doStuff(42); // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/named_param_trait_meth.php
<?hh trait Foo { public function doStuff(int $x): void {} public function callIt(): void { $this->doStuff(42); // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/named_param_variadic.php
<?hh function add_one(string $s, int ...$nums): void { } function call_it(): void { add_one("stuff", 1, 2); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/newtype.php
<?hh /** * Some docs. */ newtype myfoo = int; function return_it(): myfoo { // ^ hover-at-caret throw new Exception(); }
PHP
hhvm/hphp/hack/test/hover/property_access.php
<?hh class Foo { public int $x = 1; public function demo(): void { $this->x; // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/property_access_supportdyn.php
<?hh class Foo { public supportdyn<mixed> $x = 1; public function demo(): void { $this->x; // ^ hover-at-caret } }
PHP
hhvm/hphp/hack/test/hover/readonly_keyword_expr.php
<?hh class Foo { public function __construct(public int $prop) {} } function bar(): void { $f = readonly new Foo(); // ^ hover-at-caret }
PHP
hhvm/hphp/hack/test/hover/readonly_keyword_param.php
<?hh class Foo { public function __construct(public int $prop) {} } function bar(readonly Foo $f): void {} // ^ hover-at-caret
PHP
hhvm/hphp/hack/test/hover/readonly_keyword_property.php
<?hh class Foo { public function __construct(public int $prop) {} public readonly function isEven(): bool { // ^ hover-at-caret $prop = $this->prop; return $prop % 2 == 0; } }