Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0519bf3669fb33658be7378d66b0b03f8e6588bb
Ticket: 1493a4304444fcfbe6ed72638f404431e03a39d7
namespace upvar / TclOO problem
User & Date: aspect on 2016-07-04 15:19:31
Changes

  1. icomment:
    Just noting that it's hard to reproduce with a variation.  Moving the constructor body into a method has no effect, but:
    
    Changing the source or destination to be a pure namespace (rather than an object) - no error.
    
    Moving [variable member1] into the constructor, with or without [my] - no error.
    
    Replacing [namespace upvar] with [upvar #0] - no error.
    
    
    Minimal test case seems to be:
    
    test .. .. -body {
      oo::class create M {
        variable v
        constructor {} {
          set v Mval
        }
      }
    
      oo::class create C {
        variable v
        method x {ns} {
          set v Cval
          namespace upvar $ns v l
          return $l
        }
      }
    
      M create m
      C create c
      c x [info object namespace m]
    } -cleanup {
      M destroy
      C destroy
    } -result Mval
    
  2. login: "aspect"
  3. mimetype: "text/plain"