Eobj: Fixed inheritance checks and fixed mixin examples accordingly.

SVN revision: 70263
This commit is contained in:
Tom Hacohen 2012-04-17 10:27:37 +00:00
parent ceca1938c4
commit 544a663dd2
3 changed files with 4 additions and 6 deletions

View File

@ -68,5 +68,5 @@ mixin_class_get(void)
NULL
};
return _my_class = eobj_class_new(&class_desc, EOBJ_CLASS_BASE, NULL);
return _my_class = eobj_class_new(&class_desc, NULL, NULL);
}

View File

@ -62,7 +62,7 @@ mixin_class_get(void)
NULL
};
_my_class = eobj_class_new(&class_desc, EOBJ_CLASS_BASE, NULL);
_my_class = eobj_class_new(&class_desc, NULL, NULL);
return _my_class;
}

View File

@ -683,17 +683,15 @@ eobj_class_new(const Eobj_Class_Description *desc, const Eobj_Class *parent, ...
if ((klass->parent->desc->type != EOBJ_CLASS_TYPE_REGULAR) &&
(klass->parent->desc->type != EOBJ_CLASS_TYPE_REGULAR_NO_INSTANT))
{
/* FIXME: Actually handle it. */
ERR("Regular classes ('%s') aren't allowed to inherit from non-regular classes ('%s').", klass->desc->name, klass->parent->desc->name);
goto cleanup;
}
break;
case EOBJ_CLASS_TYPE_INTERFACE:
case EOBJ_CLASS_TYPE_MIXIN:
if ((klass->parent->desc->type != EOBJ_CLASS_TYPE_REGULAR) &&
(klass->parent->desc->type != EOBJ_CLASS_TYPE_REGULAR_NO_INSTANT))
if ((klass->parent->desc->type != EOBJ_CLASS_TYPE_INTERFACE) &&
(klass->parent->desc->type != EOBJ_CLASS_TYPE_MIXIN))
{
/* FIXME: Actually handle it. */
ERR("Non-regular classes ('%s') aren't allowed to inherit from regular classes ('%s').", klass->desc->name, klass->parent->desc->name);
goto cleanup;
}