Disallow ... without type in function typehints
[hiphop-php.git] / hphp / hack / test / typecheck / typing_fail_return_option.php
blobae0b2b27e482c5efc7759919e4a723234456f7a1
1 <?hh // partial
2 /**
3 * Copyright (c) 2014, Facebook, Inc.
4 * All rights reserved.
6 * This source code is licensed under the MIT license found in the
7 * LICENSE file in the "hack" directory of this source tree.
13 bool function is_null(Option<T> $x) {
14 return true;
17 Option<int> function test() {
18 return 0;
21 class A {
22 Option<A> $x;
24 public void function setX(A $x) {
25 $this->x = $x;
28 public A function getX(dyn $obj) {
29 $y = (!($obj is A) || $obj->setX(new A()));
30 $y = (($obj is A) && $obj->setX(new A()));
31 if (($x = $this->x) && ($x is A)) {
32 return $x;
34 return $this;