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
No error on use of `unsafe_cast`
[hiphop-php.git]
/
hphp
/
hack
/
test
/
typecheck
/
typehole
/
T91771566.php
blob
916f096208c9e2405dab7742cc34fc61168df2d8
1
<
?hh
2
3
class
C
{
4
public
arraykey
$i
=
0
;
5
6
public function
invalidate
():
int
{
7
$this
->
i
=
"42"
;
8
return
0
;
9
}
10
}
11
12
function
takes_int
(
int
$_
):
void
{}
13
14
<<
__EntryPoint
>>
15
function
main1
():
void
{
16
$c
=
new
C
();
17
$v
=
Vector
<
int
> {
0
};
18
if
(
$c
->
i is
int
) {
19
// Soundness error call to invalidate must invalidate `$c->i : int`.
20
$v
[
$c
->
invalidate
()] =
$c
->
i
;
21
// HHVM fatals
22
takes_int
(
$v
[
0
]);
23
}
24
}