Disallow ... without type in function typehints
[hiphop-php.git] / hphp / hack / test / typecheck / user_attributes_arguments.php
blob166f32098233593fcbed7255986831633d77f49a
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.
12 function f1(<<Foo(1,2,3), Bar>> $x): void {}
14 function f2(<<SingleAttribute>> $x): void {}
16 function f3(<<SingleAttributeWithOneParam(1)>> $x): void {}
18 function f4(<<SingleAttributeWithTwoParams(1,2)>> $x): void {}
20 function f5(<<Multiple(1), Attributes(2,3), Foo>> $x): void {}
22 function f6(<<Data>> ?string $x = null): void {}
24 function f7(<<Data>> $x = null): void {}
26 class Blah {
27 public function f5(<<Multiple(1), Attributes(2,"blah"), Foo>> int $x): void {
28 $x = "blah";
29 $y = "$x";
33 class Foo {}
34 class Bar {}
35 class SingleAttribute {}
36 class SingleAttributeWithOneParam {}
37 class SingleAttributeWithTwoParams {}
38 class Multiple {}
39 class Attributes {}
40 class Data {}