Shishir Ramam schrieb:
Not sure if this should be considered expected behaviour - but does the type have to be defined before declaration?
yes, the checking predicate is determined currently at definition time; if the specified "type" is not an existing class, the checker uses the "string is ..." as test method, therefore the error message.
All checking is in tcl, so it can be redefined, if you want (see method check_single_value of ::xotcl::Attribute in predefined.xotcl).
However, you can define also the slots after the class is defined:
Class DerivedA -superclass Base Class DerivedB -superclass Base
DerivedA slots { Attribute connects_to -multivalued true -type DerivedB } DerivedB slots { Attribute connects_to -multivalued true -type DerivedA }
This will work out of the box....
best regards
-gustaf neumann