Itcl - the [incr Tcl] extension

Ticket Change Details
Login
Overview

Artifact ID: ee960cebdca97d47bb2cee901d7ce779646395d57ddfd44ec264fe59aa2fb111
Ticket: 777ae99cfbf6106de0d01eb5bd11f69e64919b53
variable lookup before a common creation affects behaviour of variable resolution
User & Date: schmitzu 2019-11-04 13:25:29
Changes

  1. foundin changed to: "trunk [41ce4308a9]"
  2. icomment:
    The following script:
    package require Itcl
    itcl::class A {
       private common l1 ""
    }
    itcl::class B {
       inherit A
       puts "info exists l1=[info exists l1]"
       private common l1
       lappend l1 "one"
       puts "l1=$l1"
    }
    
    leads to this output/error:
    
    info exists l1=0
    can't access "l1": private variable
        while executing
    "lappend l1 "one""
        (class "B" body line 5)
        invoked from within
    "itcl::class B {
       inherit A
       puts "info exists l1=[info exists l1]"
       private common l1
       lappend l1 "one"
       puts "l1=$l1"
    }"
    
    Previous versions (e.g. [05b48e2011]) doesn't have this problem.
    When commenting out the "info exists" line, no error
    is thrown.
    
  3. login: "schmitzu"
  4. mimetype: "text/x-fossil-plain"
  5. private_contact changed to: "d183df1f376fe5f7c19813c014028c73fd52e281"
  6. severity changed to: "Critical"
  7. status changed to: "Open"
  8. title changed to:
    info exists affects behaviour of variable resolution
    
  9. type changed to: "Code_Defect"