Fix (disable) reporting of extended typehints via reflection

Right now (on trunk, not release), a function with a ?int
typehint tells the reflection API its typehint is just "int".  For
now, just turn this off.  (If we want this later we'll probably have
to add a new API or something?)
Esse commit está contido em:
Jordan DeLong
2013-07-09 16:44:34 -07:00
commit de Sara Golemon
commit 9584995bec
+8 -4
Ver Arquivo
@@ -423,8 +423,13 @@ static void set_function_info(Array &ret, const Func* func) {
param.set(s_index, VarNR((int)i));
VarNR name(func->localNames()[i]);
param.set(s_name, name);
const StringData* type = fpi.typeConstraint().hasConstraint() ?
fpi.typeConstraint().typeName() : empty_string.get();
auto const nonExtendedConstraint =
fpi.typeConstraint().hasConstraint() &&
!fpi.typeConstraint().isExtended();
auto const type = nonExtendedConstraint ? fpi.typeConstraint().typeName()
: empty_string.get();
param.set(s_type, VarNR(type));
const StringData* typeHint = fpi.userType() ?
fpi.userType() : empty_string.get();
@@ -434,8 +439,7 @@ static void set_function_info(Array &ret, const Func* func) {
param.set(s_class, VarNR(func->cls() ? func->cls()->name() :
func->preClass()->name()));
}
if (!fpi.typeConstraint().hasConstraint() ||
fpi.typeConstraint().nullable()) {
if (!nonExtendedConstraint || fpi.typeConstraint().nullable()) {
param.set(s_nullable, true_varNR);
}