allowed interface specification in extending a class. e.g. extend ClassName [Interface1,Interface2,etc] { ... }

This commit is contained in:
hyunghwan.chung 2018-10-12 15:57:58 +00:00
parent a21cee67e0
commit 852349b26c
2 changed files with 16 additions and 0 deletions

View File

@ -16,6 +16,16 @@ interface X11able3
method(#dual) class.
}
class QQQ(Object)
{
}
extend QQQ [X11able]
{
method(#dual) abc { ^nil }
method(#dual,#liberal) def(x, z) { ^nil }
}
class X11(Object) [X11able,selfns.X11able3] from 'x11'
{
@ -32,6 +42,7 @@ class X11(Object) [X11able,selfns.X11able3] from 'x11'
var event_loop_sem, event_loop_proc.
var llevent_blocks.
method(#dual) abc { ^nil }
method(#dual,#liberal) def(x, z) { ^nil }
###method(#dual) abc3 { ^nil }

View File

@ -8021,6 +8021,11 @@ static int __compile_class_definition (moo_t* moo, int class_type)
cc->super_oop = cc->self_oop->superclass;
MOO_ASSERT (moo, cc->super_oop == moo->_nil || MOO_CLASSOF(moo, cc->super_oop) == moo->_class);
if (TOKEN_TYPE(moo) == MOO_IOTOK_LBRACK)
{
if (process_class_interfaces(moo) <= -1) return -1;
}
}
else
{