Tcl Library Source Code

View Ticket
Login
Ticket UUID: f990aa37bc6b6f0606026bb30788c9a4bd63a70
Title: oo::classmethod inherited only once
Type: Bug Version: 1.2.2
Submitter: anonymous Created on: 2016-02-22 14:07:47
Subsystem: oo::util Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2016-02-22 14:07:47
Resolution: None Closed By: nobody
    Closed on:
Description:
Classmethod is inherited (visible) in a direct subclass, but not in the subclass of that subclass. 

The following fragment demonstrates the problem:


# **** TEST.tcl ****
package require oo::util

oo::class create MyClass {
	classmethod clm {} {
		puts "Hello"
	}
}

oo::class create MySubclass {
	superclass MyClass
}

oo::class create MySubSubclass {
	superclass MySubclass
}

MySubclass clm ; # ok, will work as expected
MySubSubclass clm ; # unknown method error!
 
# *** END TEST.tcl ***

Workaround: Redefine classmethods in every other subclass, which is not a nice solution.