Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Cannot create nested object with same name as global command

Closed / Fixed2519474fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2009-01-19 11:19:07
Sample:
(web) 1 % oo::class create C {}
::C
(web) 2 % oo::class create D {constructor {} { C create x }
> }
::D
(web) 3 % D new
::oo::Obj13
(web) 4 % proc x args {}
(web) 5 % D new
can't create object "x": command already exists with that name
(web) 6 % set errorInfo
can't create object "x": command already exists with that name
    while executing
"C create x "
    (class "::D" constructor line 1)
    invoked from within
"D new"

Definition of the outer proc x prevents creation of the "x" object within a class D instance.
dkf Ticket [2519474fff]: 1 change [History diff]2009-01-28 22:32:32
dkfplain2009-01-29 22:59:04
Subtle. The bug was that Tcl_FindCommand didn't always respect TCL_NAMESPACE_ONLY, and TclOO was tickling the bug.

Will need backporting to 8.5
dkfplain2009-01-29 23:09:29
allow_comments - 1

done
Log in (anonymous is fine) to add a comment.