This repository was archived by the owner on Aug 1, 2023. It is now read-only.
File tree 3 files changed +12
-6
lines changed
3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 13
13
matrix :
14
14
os : [ ubuntu ]
15
15
hhvm :
16
- - ' 4.102 '
16
+ - ' 4.157 '
17
17
- latest
18
18
- nightly
19
19
runs-on : ${{matrix.os}}-latest
Original file line number Diff line number Diff line change 11
11
}
12
12
},
13
13
"require" : {
14
- "hhvm" : " ^4.102 " ,
14
+ "hhvm" : " ^4.157 " ,
15
15
"hhvm/hhvm-autoload" : " ^2.0|^3.0" ,
16
16
"hhvm/hsl" : " ^4.0" ,
17
17
"hhvm/type-assert" : " ^3.2|^4.0" ,
18
- "hhvm/hhast" : " ^4.21.4 "
18
+ "hhvm/hhast" : " ^4.157 "
19
19
},
20
20
"require-dev" : {
21
21
"facebook/fbexpect" : " ^2.6.1" ,
Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ function type_constant_from_ast(
20
20
$node -> getModifiers()?-> getChildren() ?? vec [],
21
21
$t ==> $t is HHAST \AbstractToken ,
22
22
);
23
+ if ($is_abstract ) {
24
+ // multiple type constraints are supported at the syntax level
25
+ // but they do not typecheck yet; grab the first one for now
26
+ $constraints = $node -> getTypeConstraints()?-> getChildren() ?? vec [];
27
+ $typehint = C \first ($constraints )?-> getType();
28
+ } else {
29
+ $typehint = $node -> getTypeSpecifier();
30
+ }
23
31
return (
24
32
new ScannedTypeConstant (
25
33
$node ,
@@ -28,9 +36,7 @@ function type_constant_from_ast(
28
36
/* docblock = */ null ,
29
37
typehint_from_ast (
30
38
$context ,
31
- $is_abstract
32
- ? $node -> getTypeConstraint()?-> getType()
33
- : $node -> getTypeSpecifier(),
39
+ $typehint ,
34
40
),
35
41
$is_abstract
36
42
? AbstractnessToken :: IS_ABSTRACT
You can’t perform that action at this time.
0 commit comments