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
opaque types should provide proper constraints on their type params
[hiphop-php.git]
/
hphp
/
hack
/
test
/
typecheck
/
constraints
/
tapply_is_newtype.php
blob
232de4721c1033bf96fbe5519c9ec8cdcc2e6407
1
//// file1.php
2
<
?hh
// strict
3
4
interface
Constraint
<
T
as
num
> {}
5
6
newtype NewConstraint
<
T
as
num
>
as
Constraint
<
T
> =
Constraint
<
T
>;
7
8
//// file2.php
9
<
?hh
// strict
10
11
// Test that we check constraints for the 'as' part of newtypes
12
function
invalid
(
NewConstraint
<
mixed
>
$x
):
void
{}