No error on use of `unsafe_cast`
[hiphop-php.git] / hphp / hack / test / typecheck / subtype_collection_interfaces_3.php
blob853f6044dd030d19698d35a424275fb09a320227
1 <?hh // strict
2 class B {}
3 class C extends B {}
5 function foo1(Traversable<B> $x): void {}
6 function test1(Iterable<C> $x): void { foo1($x); }
8 function foo2(KeyedTraversable<mixed, B> $x): void {}
9 function test2(KeyedIterable<mixed, C> $x): void { foo2($x); }
11 function foo3(Container<B> $x): void {}
12 function test3(KeyedContainer<int, C> $x): void { foo3($x); }
14 function foo4(Iterable<B> $x): void {}
15 function test4(Vector<C> $x): void { foo4($x); }
17 function foo5(KeyedIterable<string, B> $x): void {}
18 function test5(Map<string, C> $x): void { foo5($x); }
20 function foo6(KeyedContainer<arraykey, B> $x): void {}
21 function test6(Map<string, C> $x): void { foo6($x); }
23 function foo7(Iterator<B> $x): void {}
24 function test7(KeyedIterator<int, C> $x): void { foo7($x); }
26 function foo8(KeyedIterator<mixed, B> $x): void {}
27 function test8(KeyedIterator<int, C> $x): void { foo8($x); }