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
New inference: improved error message for unresolved type
[hiphop-php.git]
/
hphp
/
hack
/
test
/
typecheck
/
covariance7.php
blob
b2c7c2b0c27b7b5b6b8237191b2b378c769c5767
1
//// file1.php
2
<
?hh
// partial
3
4
newtype ID
<
+T
> =
int
;
5
newtype UID
<
+T
>
as
ID
<
T
> =
int
;
6
newtype OID
<
+T
>
as
ID
<
T
> =
int
;
7
8
//// file2.php
9
<
?hh
// partial
10
11
class
A
{}
12
class
B
extends
A
{}
13
14
function
takesIDA
(
ID
<
A
>
$x
):
void
{}
15
function
test
(
UID
<
B
>
$x
):
void
{
16
takesIDA
(
$x
);
17
}