repo.or.cz
/
hiphop-php.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Introduce readonly variant of idx
[hiphop-php.git]
/
hphp
/
hack
/
test
/
typecheck
/
readonly
/
readonly_idx_2.php
blob
e8bbdd35f2d9843aca8c84ce6309c9f782a11ac0
1
<
?hh
2
<<
file
:
__EnableUnstableFeatures
(
"readonly"
)>>
3
4
5
class
Foo
{
6
public
int
$prop
=
4
;
7
}
8
9
function
foo
(
readonly dict
<
int
,
Foo
>
$v
) :
void
{
10
$y
=
readonly
idx_readonly
(
$v
,
5
)
as
nonnull
;
// without default should return nullable, so nonnull
11
$y
->
prop
=
5
;
12
}