Menu

#270 Namespace class deletion error

4.0*
closed-fixed
None
5
2015-12-04
2015-11-28
No

When a class defined in a namespace is deleted, it cannot be recreated. For example:

package require Itcl
namespace import itcl::*

class A::B {}
delete class A::B
class A::B {}

This generates the following error:

can't create namespace "::itcl::internal::variables::A::B": already existsITCL:cannot create variables namespace "::itcl::internal::variables::A::B"
    while executing
"class A::B {}"

Discussion

  • Don Porter

    Don Porter - 2015-11-30

    Confirmed in branch tips.

    This design botch isn't recent. Flaw dates back to at least the 4.0.0 release.

     
  • Don Porter

    Don Porter - 2015-12-04

    Trouble here is that some of class teardown is accomplished via delete traces on the access command, and those traces were being set on the simple, rather than the fully qualified, name of the command. When an action is set to take place when "B" is deleted, then it doesn't happen when "::A::B" is deleted and cleanup is incomplete, setting stage for the failure seen here.

     
  • Don Porter

    Don Porter - 2015-12-04
    • status: open --> closed-fixed
    • assigned_to: Don Porter
     

Log in to post a comment.