Fix HPHP's parser when handling generics
We need to allow any type after the AS keyword, including xhp class names.
Esse commit está contido em:
@@ -8,5 +8,8 @@ class B<T> extends A<T> { }
|
||||
function foo<T, Q as A<T> >(Q $thing, T $item): T {
|
||||
return $thing->getT($item);
|
||||
}
|
||||
class C<T as A<int>> {}
|
||||
class D<T as :x:base> {}
|
||||
class E<T as A<:x:base>> {}
|
||||
echo "Done\n";
|
||||
|
||||
|
||||
@@ -113,6 +113,7 @@ static int getNextTokenType(int t) {
|
||||
case T_BOOL_CAST:
|
||||
case T_UNSET_CAST:
|
||||
case T_UNRESOLVED_LT:
|
||||
case T_AS:
|
||||
return NextTokenType::XhpTag |
|
||||
NextTokenType::XhpClassName;
|
||||
case ',': case '(': case '|':
|
||||
|
||||
+205
-204
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
Referência em uma Nova Issue
Bloquear um usuário