Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Error mixing into oo::object

Closed / Invalid1962020fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2008-05-11 19:13:00
mixing any class into oo::object fails:

  % oo::class create L {}
  % oo::define oo::object mixin L
  may not mix a class into itself
      while executing
  "oo::define oo::object mixin L"

this appears to be triggered by the fact that L is a subclass of the class to be mixed into (i.e. oo::object).
maybe mixing into oo::object needs to be made an exception for the TclOOIsReachable() check in TclOODefineMixinObjCmd()?
dkfplain2008-05-12 19:59:53
Logged In: YES 
user_id=79902
Originator: NO

Why are you trying to mix a class into the oo::object class? That means that *every* instance of oo::object (including all classes, including L itself) will have those mixed in. Right now, that would cause an infinite loop (the code to traverse the class DAG relies on the fact that it really is a DAG) and seems crazy to me anyway!

Until I understand the use case, I'm likely to say "that's the way it's meant to work"...
sf-robotplain2008-05-27 09:20:27
Logged In: YES 
user_id=1312539
Originator: NO

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
Log in (anonymous is fine) to add a comment.