Disallow ... without type in function typehints
[hiphop-php.git] / hphp / hack / test / typecheck / newtype9.php
blob7a60a27ed0a5e7f5618e36327e3a4952f442dae2
1 //// _comments
2 <?hh // partial
4 // opaque type should not implicitly convert to string.
5 // even when the type backing it does implicit convert to
6 // a string ordinarily
8 //// newtype.php
9 <?hh // strict
11 newtype OpaqueInt = int;
13 class Opaque {
14 public OpaqueInt $opaque_int;
15 public function __construct() {
16 $this->opaque_int = 5;
20 //// useit.php
21 <?hh // strict
23 class Klass {
24 public string $foo;
25 public function __construct() {
26 $this->foo = 'B' . (new Opaque())->opaque_int;