+ break;
+
+ case PSI_T_INT:
+ if (def->type == PSI_T_NUMBER) {
+ def->type = PSI_T_INT;
+ def->ival.zend.lval = psi_num_exp_get_long(def->data.num, NULL, scope->defs);
+ psi_num_exp_free(&def->data.num);
+ }
+ if (def->type == PSI_T_INT) {
+ return true;
+ }
+ break;
+
+ case PSI_T_FLOAT:
+ case PSI_T_DOUBLE:
+ if (def->type == PSI_T_NUMBER) {
+ def->type = PSI_T_DOUBLE;
+ def->ival.dval = psi_num_exp_get_double(def->data.num, NULL, scope->defs);
+ psi_num_exp_free(&def->data.num);
+ }
+ if (def->type == PSI_T_DOUBLE) {
+ return true;
+ }
+ break;
+
+ case PSI_T_STRING:
+ if (def->type == PSI_T_STRING) {
+ return true;
+ }
+ break;
+
+ default:
+ data->error(data, def->token, PSI_WARNING,
+ "Invalid default value type '%s', "
+ "expected one of bool, int, float, string.",
+ cmp->name);